[jsword-svn] r997 - trunk/jsword-web/src/main/java/org/crosswire/jsword/view/web

dmsmith at crosswire.org dmsmith at crosswire.org
Sat Jan 28 16:52:16 MST 2006


Author: dmsmith
Date: 2006-01-28 16:52:11 -0700 (Sat, 28 Jan 2006)
New Revision: 997

Modified:
   trunk/jsword-web/src/main/java/org/crosswire/jsword/view/web/DownloadSet.java
Log:
Fix a download page bug.

Modified: trunk/jsword-web/src/main/java/org/crosswire/jsword/view/web/DownloadSet.java
===================================================================
--- trunk/jsword-web/src/main/java/org/crosswire/jsword/view/web/DownloadSet.java	2006-01-25 23:44:42 UTC (rev 996)
+++ trunk/jsword-web/src/main/java/org/crosswire/jsword/view/web/DownloadSet.java	2006-01-28 23:52:11 UTC (rev 997)
@@ -111,7 +111,9 @@
      */
     public String getDateString() throws ParseException
     {
-        Date date = DF_DISK.parse(setname);
+        // The setname may either be a VERSION_DATE or x.x.x.x-VERSION_DATE.
+        String setdate = setname.substring(setname.length() - VERSION_DATE.length());
+        Date date = DF_DISK.parse(setdate);
         return DF_USER.format(date);
     }
 
@@ -150,7 +152,8 @@
     private static final String TEST_SUFFIX = BIN_ZIP;
 
     private static final NumberFormat NF = NumberFormat.getNumberInstance();
-    private static final DateFormat DF_DISK = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
+    private static final String VERSION_DATE = "yyyyMMdd"; //$NON-NLS-1$
+    private static final DateFormat DF_DISK = new SimpleDateFormat(VERSION_DATE);
     private static final DateFormat DF_USER = new SimpleDateFormat("dd MMM yyyy"); //$NON-NLS-1$
     static
     {



More information about the jsword-svn mailing list