From 38f09a0f168d331f2750534d6784af1f707cad3b Mon Sep 17 00:00:00 2001 From: Tim Su Date: Fri, 13 Aug 2010 04:24:26 -0700 Subject: [PATCH] fix for AST-234: producteev date formatting in other languages broken --- .../astrid/producteev/api/ApiUtilities.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/producteev/api/ApiUtilities.java b/astrid/plugin-src/com/todoroo/astrid/producteev/api/ApiUtilities.java index 5d0a4f89b..f23ad9b2d 100644 --- a/astrid/plugin-src/com/todoroo/astrid/producteev/api/ApiUtilities.java +++ b/astrid/plugin-src/com/todoroo/astrid/producteev/api/ApiUtilities.java @@ -18,8 +18,11 @@ public final class ApiUtilities { private static final SimpleDateFormat timeParser = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z"); //$NON-NLS-1$ - private static final SimpleDateFormat dateParser = new SimpleDateFormat( - "EEE, dd MMM yyyy"); //$NON-NLS-1$ + private static final SimpleDateFormat timeWriter = new SimpleDateFormat( + "yyyy/MM/dd HH:mm:ss Z"); //$NON-NLS-1$ + + private static final SimpleDateFormat dateWriter = new SimpleDateFormat( + "yyyy/MM/dd"); //$NON-NLS-1$ /** * Utility method to convert PDV time to unix time @@ -44,8 +47,8 @@ public final class ApiUtilities { * @return */ public static String unixTimeToProducteev(long time) { - synchronized(timeParser) { - return timeParser.format(DateUtilities.unixtimeToDate(time)); + synchronized(timeWriter) { + return timeWriter.format(DateUtilities.unixtimeToDate(time)); } } @@ -55,8 +58,8 @@ public final class ApiUtilities { * @return */ public static String unixDateToProducteev(long date) { - synchronized(dateParser) { - return dateParser.format(DateUtilities.unixtimeToDate(date)); + synchronized(dateWriter) { + return dateWriter.format(DateUtilities.unixtimeToDate(date)); } }