[
https://issues.apache.org/jira/browse/TAPESTRY-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jesse Kuhnert updated TAPESTRY-888:
-----------------------------------
Fix Version/s: (was: 4.1.3)
4.1.4
> DatePicker.js does not support 12-hour time format.
> ---------------------------------------------------
>
> Key: TAPESTRY-888
> URL: https://issues.apache.org/jira/browse/TAPESTRY-888
> Project: Tapestry
> Issue Type: Improvement
> Components: Framework
> Affects Versions: 4.0
> Environment: n/a
> Reporter: Ryan Holmes
> Priority: Minor
> Fix For: 4.1.4
>
>
> DatePicker.js ignores 'h' and 'a' characters in a date translator pattern. It
> would be nice to support these since they are fairly common.
> I would have included a real patch, but DatePicker.js is has an svn:mime-type
> property of application/octet-stream in the repository so I couldn't find an
> easy way to generate one.
> The following needs to be added starting at line 805:
> bits['h'] = getHoursAmPm(date);
> bits['hh'] = pad(getHoursAmPm(date),2);
> bits['a'] = getAmPm(date);
> The keys array needs to include these as well:
> var keys = new
> Array('dddd','ddd','dd','d','MMMM','MMM','MM','M','yyyy','yy', 'ss', 's',
> 'mm',
> 'm', 'HH', 'H', 'hh', 'h', 'a');
> And these functions need to be added:
> function getHoursAmPm(date) {
> var hours = date.getHours();
> if (hours == 0) hours = 12;
> if (hours > 12) hours -= 12;
> return hours;
> }
> function getAmPm(date) {
> var ampm = "AM";
> if (date.getHours() > 11) ampm = "PM";
> return ampm;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]