You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Goran Karlic (JIRA)" <ji...@apache.org> on 2008/02/21 22:45:19 UTC

[jira] Created: (JSPWIKI-196) Date and time format accoding to ISO 8601

Date and time format accoding to ISO 8601
-----------------------------------------

                 Key: JSPWIKI-196
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
             Project: JSPWiki
          Issue Type: Improvement
          Components: Localization
    Affects Versions: 2.6.1
         Environment: Any
            Reporter: Goran Karlic
            Priority: Trivial


We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).

My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time.

I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).

Following this proposal java format strings would be allowed for above cases would be: 

(1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
(2) Date and time
(2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
(2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")

Where (2.1) would be used for strings that might emerge from different time-zones.

If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by Dirk Frederickx <di...@gmail.com>.
Better would be to use the default time-format as selected from
jspwiki.properties or the user preferences  (ref. the  Preferences
class)

This is already mostly the case in the JSP's, but not yet across the
complete code-base.


dirk

On 2/21/08, Murray Altheim <mu...@altheim.com> wrote:
> +1
>
> I don't know what impact this will have on others but it's certainly
> fine by me -- it's the same decision I made on my own projects a while
> back -- this is compatible for my systems and a sensible/defensible
> default.
>
> Murray
>
> Goran Karlic (JIRA) wrote:
> > Date and time format accoding to ISO 8601
> > -----------------------------------------
> >
> >                  Key: JSPWIKI-196
> >                  URL: https://issues.apache.org/jira/browse/JSPWIKI-196
> >              Project: JSPWiki
> >           Issue Type: Improvement
> >           Components: Localization
> >     Affects Versions: 2.6.1
> >          Environment: Any
> >             Reporter: Goran Karlic
> >             Priority: Trivial
> >
> >
> > We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> >
> > My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time.
> >
> > I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> >
> > Following this proposal java format strings would be allowed for above cases would be:
> >
> > (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> > (2) Date and time
> > (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> > (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> >
> > Where (2.1) would be used for strings that might emerge from different time-zones.
> >
> > If others agree with this proposal, I would gladly make the required changes.
> >
>
>
> --
>
> ...........................................................................
> Murray Altheim <murray07 at altheim.com>                           ===  = =
> http://www.altheim.com/murray/                                     = =  ===
> SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =
>
>       Boundless wind and moon - the eye within eyes,
>       Inexhaustible heaven and earth - the light beyond light,
>       The willow dark, the flower bright - ten thousand houses,
>       Knock at any door - there's one who will respond.
>                                       -- The Blue Cliff Record
>

Re: [jira] Created: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by Murray Altheim <mu...@altheim.com>.
+1

I don't know what impact this will have on others but it's certainly
fine by me -- it's the same decision I made on my own projects a while
back -- this is compatible for my systems and a sensible/defensible
default.

Murray

Goran Karlic (JIRA) wrote:
> Date and time format accoding to ISO 8601
> -----------------------------------------
> 
>                  Key: JSPWIKI-196
>                  URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>              Project: JSPWiki
>           Issue Type: Improvement
>           Components: Localization
>     Affects Versions: 2.6.1
>          Environment: Any
>             Reporter: Goran Karlic
>             Priority: Trivial
> 
> 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> 
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time.
> 
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> 
> Following this proposal java format strings would be allowed for above cases would be: 
> 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> 
> Where (2.1) would be used for strings that might emerge from different time-zones.
> 
> If others agree with this proposal, I would gladly make the required changes.
> 


-- 

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

[jira] Commented: (JSPWIKI-196) Consistent date and time formats

Posted by "Goran Karlic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571778#action_12571778 ] 

Goran Karlic commented on JSPWIKI-196:
--------------------------------------

Thank You, that leaves my questions sattisfied.

I am onto the plugin and just figured out we too have following:

CurrentTimePlugin
{code}
    public static final String DEFAULT_FORMAT = "HH:mm:ss dd-MMM-yyyy zzzz";
{code}

PluginResources.properties
{code}
common.dateformat = HH:mm:ss dd-MMM-yyyy zzzz
{code}
This property seems not to be used, and if should be replaced with {{jspwiki.defaultprefs.template.dateformat}}

> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571420#action_12571420 ] 

Janne Jalkanen commented on JSPWIKI-196:
----------------------------------------

Yah, I think this is quite valid issue, but the solution I'm not that happy about (I'm no fan of ISO8601 myself).  Maybe we just add the formats into the property files as "yet another localizable string"?  Or maybe have a property setting in the jspwiki.properties.

The browser locale might not though be the correct place to solve this, since that would mean that each comment could come with a different format...

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571700#action_12571700 ] 

Andrew Jaquith commented on JSPWIKI-196:
----------------------------------------

Ok, that's fair comment. I'm not as knowledgeable as you are about how and when particular JSPs do things like Comment.jsp does.

I may have erred in suggesting something a little to specific for all situations. However, it seems that we both agree on the core issue: how to *write* dates to some destination (into page markup, or as page metadata), and how to *display* dates ("render internal dates"). If you modify your issue 3) above, you'll see that it makes sense: "...for cases where we *write* the dates directly on the page content."

I suspect where you and the Goran might disagree is the correct internal format to use for "write" operations. I don't have an opinion, although on balance I generally lean towards configurable options, and away from hard-coded ones.

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Goran Karlic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571514#action_12571514 ] 

Goran Karlic commented on JSPWIKI-196:
--------------------------------------

When using user preferences / browser locale to resolve DateTime formats can result in different formats appearing in comments / pages. This could be solved by introducing a new "DateTime format property", which seems a good compromise to me.

Do you know about any "hard-coded" format strings used in JSPWiki where access to this new property would not be possible / undesirable?

Do you think ISO8601 is a good default setting for this new property?

Do you think ISO8601 is a good default setting for all template properties?

Janne: ISO8601 can be seen as an internationaly achieved compromise on this issue; I would even say: "It seems accepted in the scientific comunity, which currently best represents the human elite, where elite is defined as the upper quantile of the gaussian distribution of the average fitness function."

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571615#action_12571615 ] 

Andrew Jaquith commented on JSPWIKI-196:
----------------------------------------

I think we need to focus this discussion a little. There are two issues here, I think:
- How DateTimes are *stored* internally, for example as page metadata 
- How they are *rendered* to end-users in their browsers

It isn't obvious to me which of these two issue this bug is about. I'd recommend that the committers (or the bug author) re-title this bug to make it more precise.

That said, it seems to me that the right strategy is to always store DateTimes in a neutral format (ISO 8601 is fine with me), but make sure that components that render text for end-users use formats suitable for the browser's locale.

On that latter point (rendering), the best way to display dates appropriately is to determine the correct Locale via HttpServletRequest.getLocale(). Rendering components, therefore, should make sure they obtain this locale. By the way, in JSPWiki 3.0 we will have a nice, reliable way to make sure that the request always has the correct Locale (courtesy of Stripes), so this technique should be quite future-proof.

If everyone agrees with this approach, then the next step is to start identifying precise places where we deviate from it. Specific cases where we've deviated (date storage v. date rendering) should all be filed as separate bugs.

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Consistent date and time formats

Posted by "Goran Karlic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571766#action_12571766 ] 

Goran Karlic commented on JSPWIKI-196:
--------------------------------------

Dirk, I find both your ideas good. This seems to me the best solution for the things discussed here. It would make things quite configurable.

* What is the pattern for the value parameter in the DATE plugin?
* Should this pattern support explicit time zones?
* What is the pattern's implicit time zone - UTC or server? 

My argumentation here:
* ISO-8601 (2008-02-28 17:12:18) should be used for the pattern, optional precision to the second
* Explicit time zones would leave it more flexible (f. i. 2008-02-28 18:12:18+0100)
* Implicit UTC would make content moveable between servers in different timezones  (f. i. 2008-02-28 17:12:18+0100)

Janne: being myself an astronomer I might be too sensitive about time zones and I might be overdoing it on ISO-8601; I am neither a fan nor non-fan of ISO-8601 - it is just that I don't know about a better default.


> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Consistent date and time formats

Posted by "Dirk Frederickx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571770#action_12571770 ] 

Dirk Frederickx commented on JSPWIKI-196:
-----------------------------------------


The plugin would take the default date pattern from the user preferences. Idem for the timezone.

jspwiki.properties
{code}
jspwiki.defaultprefs.template.dateformat =dd-MMM-yyyy HH:mm

# default timezone expressed in time in milliseconds added to UTC 
# by default, the default timezone is read from the server
# jspwiki.defaultprefs.template.timezone =3600000
{code}



> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Consistent date and time formats

Posted by "Florian Holeczek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587554#action_12587554 ] 

Florian Holeczek commented on JSPWIKI-196:
------------------------------------------

Mhh not much time for this at the moment, sorry... Just found this one
coincidentally while browsing for l10n issues.
Maybe the original reporter wants to do this?

Regards,
 Florian

Ursprüngliche Nachricht vom 10.04.2008 um 11:23:
> Hi Florian,
>
> Could you break the JSPWIKI-196 up in piecese, cause there are several
> issues: new DATE plugin (may need some further elaboration), bugfixes
> on current plugins which are not yet using the user-prefs date/time
> format.
>
>
> dirk
>
> On Thu, Apr 10, 2008 at 10:15 AM, Florian Holeczek <fl...@holeczek.de> wrote:
>> This one goes to Dirk: You've modified 2.7 regarding date formats.
>>  I've seen that there has already been a discussion about this in
>>  JSPWIKI-196. Could you have a look at it?
>
>>  Regards,
>>   Florian


> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571657#action_12571657 ] 

Janne Jalkanen commented on JSPWIKI-196:
----------------------------------------

Andrew: incorrect.  The question was about things like Comment.jsp which actually *writes* the datetime onto the page.  In this case, the locale of the browser is actually *damaging* the situation, because all comment dates would be written in whatever locale the user might be using.  So you would see dates in Finnish if I commented on something.

I'm seeing at least three different things being discussed here.  I would like to propose that someone splits these into these separate issues

1) usage of ISO8601 as the default time format (which I believe is crap, and JSPWiki is not a scientific project.  You're not seeing greek letters anywhere either, and scientists regularly use those as variable names.  I know, I'm a trained physicist.)
2) making sure wherever we render internal dates we use browser locales properly
3) adding an property-settable datetime format for cases where we render the dates directly on the page content (like Comment.jsp).

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Consistent date and time formats

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574256#action_12574256 ] 

Janne Jalkanen commented on JSPWIKI-196:
----------------------------------------

That seems like a genuine bug, yes.  However, this issue report is too confusing now, so there's no way to fix it.  Could the original reporter please split it into separate issues?

> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JSPWIKI-196) Consistent date and time formats

Posted by "Goran Karlic (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Goran Karlic resolved JSPWIKI-196.
----------------------------------

    Resolution: Duplicate

Produces several clones to split the issue in more explicit and thus solvable issues.

> Consistent date and time formats
> --------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> +This issue was changed to better reflect the initiated discussion+
> Focus is on:
> * How DateTimes are *stored* internally, for example as page content or metadata (comments etc.)
> * How they are *rendered* to end-users in their browsers
> {quote}
> The original issue name was:  _Date and time formats according to ISO 8601_. 
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Florian Holeczek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571207#action_12571207 ] 

Florian Holeczek commented on JSPWIKI-196:
------------------------------------------

What exactly do you mean?

If you just want to change the standard setting to an international standard, while preserving the admin and user option to select a localized/custom format, I think that's fine!

If you want to generally change the format to the above cited ones, I must say this isn't localization but the opposite. I've recently added some formats for Germany. BTW, de.wikipedia.org says for me "Diese Seite wurde zuletzt am 19. Februar 2008 um 21:41 Uhr geändert.".

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Dirk Frederickx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571745#action_12571745 ] 

Dirk Frederickx commented on JSPWIKI-196:
-----------------------------------------


Rendering time/dates :

All template JSPs are currently using JSTL for date formatting. For example:  
{code}
<fmt:formatDate value="<%= firstPage.getLastModified() %>" pattern="${prefs['DateFormat']}" />
{code}
This formats the date according to the preferred date-format (the default is read from jspwiki.properties) and according to the default locale, which typically is taken from the user's browser.

However, several plugins and tags (RecentChangesPlugin, CurrentTimePlugin, WebLogPlugin, ...)  are using there own cooking to  format dates. 

To resolve this, I would recommend to introduce a helper function to format dates consistently, which uses the selected preferences and default browser settings.

So you can use from plugin code :
{code}
  SimpleDateFormat fmt = Preferences.getDateFormat( pagecontext );
{code}


NOTE:

This still doesn't resolve the issue of writing dates onto the page contents. The proposed ISO8601 format seems like a good choice, but indeed not very user-friendly. 

So, why not wrap this (automatic generated) page-content dates into a jspwiki plugin ? Like this:
{code}

Lorem ipsum dolor sit amet, [{DATE value='20080229' }]  consectetuer adipiscing elit. 

{code}

The DATE plugin would make sure the date gets rendered according to preferences / browsers locale. 


dirk



> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601

Posted by "Goran Karlic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571415#action_12571415 ] 

Goran Karlic commented on JSPWIKI-196:
--------------------------------------

The only thing I would like to change are the hard-coded and/or localization context unaware strings (f. i, the time inserted for new comments by "Comment.jsp").

I do not wish to take or modify the possibilty for the user / admin to change the preferences. That, indeed, would be the opposite to localization.

Wikipedia is mentioned above as a source of information (reference), not as an expample.

> Date and time format accoding to ISO 8601
> -----------------------------------------
>
>                 Key: JSPWIKI-196
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-196
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
>
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions (page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default. The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show time with the precision to the second, as the SI unit system defines the second as the basic unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second (s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20 22:38:10+0100")
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.