JAL-3446 from applet - Cache news date fix
authorBobHanson <hansonr@stolaf.edu>
Tue, 9 Jun 2020 06:25:37 +0000 (01:25 -0500)
committerBobHanson <hansonr@stolaf.edu>
Tue, 9 Jun 2020 06:25:37 +0000 (01:25 -0500)
- US time stored differently, I guess.

src/jalview/bin/Cache.java

index a89714a..69f5f63 100755 (executable)
@@ -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 '"