#821 closed defect (fixed)
dropdowndatepicker: change will not reflect in widget if input is in german format
Reported by: | anonymous | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.3 |
Keywords: | dropdowndatepicker | Cc: | |
Blocked By: | Blocking: |
Description
When entering a date in the format "31.12.2006" (DD.MM.YYYY) the widget will not be updated. The only format accepted will be "2006/12/31" (YYYY/MM/DD). It would be great if the timeformat set will also be used when entering data in textfield.
Attachments (1)
Change History (11)
comment:1 Changed 15 years ago by
Milestone: | 0.3.1 → 0.4 |
---|
comment:2 Changed 15 years ago by
Priority: | normal → high |
---|
Changed 15 years ago by
Attachment: | dojo-test.zip added |
---|
zip with a java implementation of dojo.date.parse
comment:4 Changed 15 years ago by
Owner: | changed from anonymous to dylan |
---|---|
Status: | new → assigned |
comment:7 Changed 15 years ago by
Owner: | changed from dylan to Adam Peller |
---|---|
Status: | assigned → new |
comment:9 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Seems that tickets #721 and #1008 are related. The following patch (two lines of code) resolves the most urgent needs:
1.- When the form has already a value in a non-US format, the input field respects that. 2.- When the input field has invalid input (e.g. xxx) the input text field should show the unmodified value (currently it shows NaN/NaN/NaN)
I have added two testcases to the sample html page in the patch, one for i18n and another for invalid dates.
A complete solution to this ticket would require a method to parse dates. Current methods format but they do not parse, so manually entered dates cannot be communicated to the DatePicker? (should be done at onInputChange and fillInTemplate). There is a good candidate for this in datetime.js (dojo.validate.isValidDate), that parses a whole date with a given format and only returns true or false. With minor changes it could return the parsed date and solve this bug.
To check the bug that we are resolving, open the html page in the browser before and after applying the patch. Since this is a showstopper for any non-US users (me included!), I have upgraded the priority.