From: BobHanson Date: Tue, 9 Jun 2020 06:25:37 +0000 (-0500) Subject: JAL-3446 from applet - Cache news date fix X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=40373abd3960216c8f34dfcda7ed7f2adc2db99b;p=jalview.git JAL-3446 from applet - Cache news date fix - US time stored differently, I guess. --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index a89714a..69f5f63 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1048,11 +1048,16 @@ public class Cache implements ApplicationSingletonI public static Date getDateProperty(String propertyName) { String val = getProperty(propertyName); + if (val != null) { try { - return date_format.parse(val); + if ((val = val.trim()).indexOf(",") < 0 && val.indexOf("-") >= 0 && val.indexOf(" ") == val.lastIndexOf(" ")) { + val = val.replace(" ",", ").replace('-',' '); + } + Date date = date_format.parse(val); + return date; } catch (Exception ex) { System.err.println("Invalid or corrupt date in property '"