From 90bed6a60008dace287e78316a73cd486bd425a3 Mon Sep 17 00:00:00 2001 From: darolmar Date: Fri, 30 Aug 2013 10:17:00 +0200 Subject: [PATCH] i18n date/time handling --- src/jalview/bin/Cache.java | 5 ++--- src/jalview/gui/BlogReader.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 5d26b85..f3c8745 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -17,13 +17,13 @@ */ package jalview.bin; +import jalview.util.MessageManager; import jalview.ws.dbsources.das.api.DasSourceRegistryI; import jalview.ws.dbsources.das.datamodel.DasSourceRegistry; import java.awt.Color; import java.io.*; import java.text.DateFormat; -import java.text.SimpleDateFormat; import java.util.*; import org.apache.log4j.*; @@ -780,8 +780,7 @@ public class Cache setProperty(property, jalview.util.Format.getHexString(colour)); } - public static final DateFormat date_format = SimpleDateFormat - .getDateTimeInstance(); + public static final DateFormat date_format = DateFormat.getDateInstance(DateFormat.LONG,MessageManager.getLocale()); /** * store a date in a jalview property diff --git a/src/jalview/gui/BlogReader.java b/src/jalview/gui/BlogReader.java index 25b5ea3..c0cfb78 100644 --- a/src/jalview/gui/BlogReader.java +++ b/src/jalview/gui/BlogReader.java @@ -351,7 +351,7 @@ public class BlogReader extends JPanel java.util.Date earliest = null; try { - earliest = new SimpleDateFormat("YYYY-MM-DD").parse(chan + earliest = new SimpleDateFormat("YYYY-MM-DD",MessageManager.getLocale()).parse(chan .getHTTPLastModified()); } catch (Exception x) { @@ -836,7 +836,7 @@ class ItemsRenderer extends DefaultListCellRenderer Item item = (Item) value; if (item.getPublishDate() != null) { - component.setText(MessageManager.formatMessage("label.blog_item_published_on_date", new String[]{DateFormat.getDateInstance().format(item.getPublishDate()).toString(),item.getTitle()})); + component.setText(MessageManager.formatMessage("label.blog_item_published_on_date", new String[]{DateFormat.getDateInstance(DateFormat.LONG, MessageManager.getLocale()).format(item.getPublishDate()).toString(),item.getTitle()})); } component.setToolTipText(item.getLink()); if (!item.isRead()) -- 1.7.10.2