Author: jalkanen
Date: Tue Sep 30 00:59:27 2008
New Revision: 700378

URL: http://svn.apache.org/viewvc?rev=700378&view=rev
Log:
Fixed off-by-one error in month calculation.

Modified:
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js?rev=700378&r1=700377&r2=700378&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js (original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js Tue Sep 30 
00:59:27 2008
@@ -38,7 +38,7 @@
                // FIXME: This is a kludge; should really insert a Date plugin 
or something.
                var now = new Date();
                var day = ((now.getDate() < 10) ? "0" + now.getDate() : 
now.getDate())
-               var month = ((now.getMonth() < 10) ? "0" + now.getMonth() : 
now.getMonth())
+               var month = ((now.getMonth() < 9) ? "0" + (now.getMonth()+1) : 
(now.getMonth()+1) )
                var currentDate = now.getFullYear() + "-" + month + "-" + day;
         
                return {
@@ -132,6 +132,7 @@
                tab:[Wiki.UserName,currentDate,'']
        },
        /* TODO: how to insert the proper current date/timestamp, inline with 
the preferred time format */
+       /* TODO: Should be localized. */
        "date" : {
                //return new object snippet
                command: function(k) {


Reply via email to