UI Plugin

DatePicker: should accept a date format string that will be applied to input box

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0.2
  • Component/s: None
  • Labels:
    None

Description

MM/DD/YYYY HH:MM:SS.SSS A

or mmm dd, YYYY

Whatever, just some way the user can send in a date format... probably the standard Java date format.

Activity

Hide
Daniel Honig added a comment -

So I just checked in a pretty complete first take on resolving this issue.
I do not believe that at the moment the code I've checked in correctly addresses time zone and locale correctly. But at the moment I've checked in good first stab at getting this issue resolved. Wanted to put this in place and get some comments before moving forward. The approach I've taken should support something like 90% of the formats possible with java.text.SimpleDateFormat.

One Issue is that the datepicker currently supports only the notion of 12 hour time. If you use a 24 hour time format string then there is mismatch in the way the time is presented and selected. I'd like to gather some comments and then I'll press on and get this resolved.

Show
Daniel Honig added a comment - So I just checked in a pretty complete first take on resolving this issue. I do not believe that at the moment the code I've checked in correctly addresses time zone and locale correctly. But at the moment I've checked in good first stab at getting this issue resolved. Wanted to put this in place and get some comments before moving forward. The approach I've taken should support something like 90% of the formats possible with java.text.SimpleDateFormat. One Issue is that the datepicker currently supports only the notion of 12 hour time. If you use a 24 hour time format string then there is mismatch in the way the time is presented and selected. I'd like to gather some comments and then I'll press on and get this resolved.
Hide
Matthew Taylor added a comment - - edited

Daniel, this seems to be working very well, great job. I tested out some format strings, and everything worked for me. I noticed that the default format of 'dd/mm/yy' didn't display time inputs when 'includTime' was true, so I made a small change to make sure time was displayed by default.

Once you get the 12/24 hr clock thing worked out, I would suggest you test in Safari, IE, and Firefox.

This is a big improvement to the tag, and several people have been wanting it. Thanks again!

Show
Matthew Taylor added a comment - - edited Daniel, this seems to be working very well, great job. I tested out some format strings, and everything worked for me. I noticed that the default format of 'dd/mm/yy' didn't display time inputs when 'includTime' was true, so I made a small change to make sure time was displayed by default. Once you get the 12/24 hr clock thing worked out, I would suggest you test in Safari, IE, and Firefox. This is a big improvement to the tag, and several people have been wanting it. Thanks again!
Hide
Florent Blanvillain added a comment -

How did you test that (Matthew)? I installed GrailsUI 1.02 SNAPSHOT but it doesn't seems to change anything. Is there another property to set up except the dateFormat property?
My goal is to make a webapp french localized, so i need a 24hour time format, localization of the labels and so on..
By the way, do you plan to facilitate the internationalization of the datePicker in the future (Daniel)?

Show
Florent Blanvillain added a comment - How did you test that (Matthew)? I installed GrailsUI 1.02 SNAPSHOT but it doesn't seems to change anything. Is there another property to set up except the dateFormat property? My goal is to make a webapp french localized, so i need a 24hour time format, localization of the labels and so on.. By the way, do you plan to facilitate the internationalization of the datePicker in the future (Daniel)?
Hide
Matthew Taylor added a comment -

Florent, this issue is not yet resolved, so I wouldn't expect to see it until the 1.0.2 full release. Also, you may try clearing out the ~/.grails/1.0.3/plugins/grails-ui cache and reinstalling (insert your grails version number).

Show
Matthew Taylor added a comment - Florent, this issue is not yet resolved, so I wouldn't expect to see it until the 1.0.2 full release. Also, you may try clearing out the ~/.grails/1.0.3/plugins/grails-ui cache and reinstalling (insert your grails version number).
Hide
Matthew Taylor added a comment -

Daniel, I had a misunderstanding about what the 24-hr issue was. Now I understand that it is nothing that affects the functionality of the formatting. It is just that the select fields in the time input don't display with 24 options in the hours (and no AM/PM).

I really don't think this is a big deal, so I'm going to go ahead and close it.

Show
Matthew Taylor added a comment - Daniel, I had a misunderstanding about what the 24-hr issue was. Now I understand that it is nothing that affects the functionality of the formatting. It is just that the select fields in the time input don't display with 24 options in the hours (and no AM/PM). I really don't think this is a big deal, so I'm going to go ahead and close it.

People

Vote (4)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: