Cleaning. Fix error between RAW and ISO date.

This commit is contained in:
Christian P. MOMON 2010-08-14 18:45:54 +02:00
parent ffa7638460
commit cf74345424

13
src/fr/devinsy/util/DateHelper.java Executable file → Normal file
View file

@ -5,10 +5,10 @@
*/ */
package fr.devinsy.util; package fr.devinsy.util;
import java.util.Calendar; import java.util.Calendar;
import java.util.GregorianCalendar; 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"; 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 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 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)$"; 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; String result;
@ -91,7 +92,7 @@ public class DateHelper
/** /**
* *
*/ */
public String americanFormat (Calendar time) public String rawFormat (Calendar time)
{ {
String result; String result;