From cf743454248fbebd7fef58fee60db5569b5e968f Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 14 Aug 2010 18:45:54 +0200 Subject: [PATCH] Cleaning. Fix error between RAW and ISO date. --- src/fr/devinsy/util/DateHelper.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) mode change 100755 => 100644 src/fr/devinsy/util/DateHelper.java diff --git a/src/fr/devinsy/util/DateHelper.java b/src/fr/devinsy/util/DateHelper.java old mode 100755 new mode 100644 index 5004c4b..107a03b --- a/src/fr/devinsy/util/DateHelper.java +++ b/src/fr/devinsy/util/DateHelper.java @@ -5,10 +5,10 @@ */ package fr.devinsy.util; - import java.util.Calendar; import java.util.GregorianCalendar; -import java.util.regex.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** @@ -18,13 +18,14 @@ public class DateHelper { public String LINE_SEPARATOR = "\n"; - static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (DateHelper.class); + //static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (DateHelper.class); static final String EUROPEAN_DATE_PATTERN = "^([0123]{0,1}\\d)/([01]{0,1}\\d)/(\\d\\d\\d\\d)$"; static final String RAW_DATE_PATTERN = "^(\\d\\d\\d\\d)([01]\\d)([0123]\\d)$"; - static final String ISO_DATE_PATTERN = "^(\\d\\d\\d\\d)([01]\\d)([0123]\\d)$"; + static final String ISO_DATE_PATTERN = "^(\\d\\d\\d\\d)-([01]\\d)-([0123]\\d)$"; static final String AMERICAN_DATE_PATTERN = "^([01]{0,1}\\d)/([0123]{0,1}\\d)/(\\d\\d\\d\\d)$"; + /** * */ @@ -70,7 +71,7 @@ public class DateHelper /** * */ - public String rawFormat (Calendar time) + public String americanFormat (Calendar time) { String result; @@ -91,7 +92,7 @@ public class DateHelper /** * */ - public String americanFormat (Calendar time) + public String rawFormat (Calendar time) { String result;