From cf78d377f0a9bbefd33b05166219f517296665b1 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Fri, 22 Oct 2010 18:31:59 +0200 Subject: [PATCH] Add short date functionality. --- src/fr/devinsy/util/DateHelper.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 af9e248..99a0930 --- a/src/fr/devinsy/util/DateHelper.java +++ b/src/fr/devinsy/util/DateHelper.java @@ -21,6 +21,7 @@ public class DateHelper //static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (DateHelper.class); static final String EUROPEAN_DATE_FORMAT = "%02d/%02d/%04d"; + static final String SHORT_EUROPEAN_DATE_FORMAT = "%02d/%02d"; static final String RAW_DATE_FORMAT = "%04d%02d%02d"; static final String ISO_DATE_FORMAT = "%04d-%02d-%02d"; static final String AMERICAN_DATE_FORMAT = "%02d/%02d/%04d"; @@ -52,6 +53,27 @@ public class DateHelper } + /** + * + */ + static public String shortEuropeanFormat (Calendar time) + { + String result; + + if (time == null) + { + result = ""; + } + else + { + result = String.format (SHORT_EUROPEAN_DATE_FORMAT, time.get(Calendar.DAY_OF_MONTH), time.get(Calendar.MONTH) + 1); + } + + // + return (result); + } + + /** * */