[ 
https://issues.apache.org/jira/browse/JSPWIKI-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634125#action_12634125
 ] 

Stefan Bohn commented on JSPWIKI-373:
-------------------------------------

Hello,

I just thought about the fixed date format.

At the moment, the date is generated only once when the button is clicked. This 
String is saved in the page source code.
If users with different locales add a comment to a page, these comments all 
would have different formated dates.

--- User one 2008-09-18
--- User two 2008/19/09
--- User three 20.09.2008
etc.

When we store the date/timestamp in ISO format, all comments are stored the 
same.

Maybe, the render can reformat the date while generating the html output 
depending on users locales.

Problem: What about dates / timestamp on a page, that did not belong to a 
comment (eg. a SQL-Where-Clause)?
There could be a new "tag/wiki syntax/plugin" to tell the renderer, which 
timestamps must be reformated.

So the editor should generate source code like this:

tag/wiki-syntax (eg.  "[&...&]")
--- User four [&2008-09-18 20:15:00.456&]

Plugin
--- User five [{TimeFormatterPlugin value='2008-09-18 20:15:00.456'}]



> 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
>             Fix For: 2.8
>
>
> ,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.

Reply via email to