[
https://issues.apache.org/jira/browse/JSPWIKI-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629542#action_12629542
]
Stefan Bohn commented on JSPWIKI-373:
-------------------------------------
I don't know much about javascript - I didn't even understand that
jspwiki-edit.js!
I read about the javascript-Date-Object and tried to format the Date.
It's just a quick hack...
If there's a smarter way to format the date, that would be great - I'm not
lucky with my code, either...
In Java I would have used a Formatter and the Locale... but Javascript is not
Java...
> jspwiki-edit.js: sign - Date (25 Sep 07) is a hard coded string in
> javascript-file
> ----------------------------------------------------------------------------------
>
> Key: JSPWIKI-373
> URL: https://issues.apache.org/jira/browse/JSPWIKI-373
> Project: JSPWiki
> Issue Type: Bug
> Components: Editors
> Affects Versions: 2.6.3, 2.8
> Environment: All platforms and browsers
> Reporter: Stefan Bohn
> Priority: Trivial
>
> ,sign:{snippet:["\\\\\n--",Wiki.UserName+", 25 Sep
> 07","\n"],tab:[Wiki.UserName,"25 Sep 07",""]}
> 25 Sep 07 is hard coded
> Solution:
> 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 currentDate = now.getFullYear() + "-" + month + "-" + day;
> ,sign:{snippet:["\\\\\n--",Wiki.UserName+", " +
> currentDate,"\n"],tab:[Wiki.UserName,currentDate,""]}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.