Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1008 closed defect (fixed)

dropdowndatepicker can't handle other date formats

Reported by: guest Owned by: Adam Peller
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

I have a <div dojoType="dropdowndatepicker" inputName="mydate" date="04/25/1969" dateformat="%d/%m/%Y"> in my webpage, but first of all if I don't specify the date in the US format it shows up incorrect. But even when I do format it (the date parameter) in US format, and it initially shows up correct (being %d/%m/%Y format), whenever I change the date to for example 24/04/1969, and press the icon, the show calendar jumps to a completely different date in december 1970.

Attachments (4)

t1008.patch (2.0 KB) - added by guest 13 years ago.
test_dddp.html (936 bytes) - added by guest 13 years ago.
dddp-i18n-r5597.patch (3.5 KB) - added by Adam Peller 13 years ago.
Use dojo.date.format/dojo.date.parse to render and accept dates from the input widget in various formats
test_DropdownDatePicker_localize.html (2.4 KB) - added by Adam Peller 13 years ago.
new tests for localization

Download all attachments as: .zip

Change History (14)

comment:1 Changed 13 years ago by dylan

Milestone: 0.4
Owner: changed from anonymous to dylan

comment:2 Changed 13 years ago by dylan

Status: newassigned

Changed 13 years ago by guest

Attachment: t1008.patch added

Changed 13 years ago by guest

Attachment: test_dddp.html added

comment:3 Changed 13 years ago by bookstack@…

Resolution: fixed
Status: assignedclosed

This bug is caused by the DropdownDatePicker? get the date string regardless the format.

Attached t1008.patch:

the patch to address this problem, applies to DropdownDatePicker?.js revision 5022;

attached test_dddp.html:

test case for this patch, please put it in trunk/tests/

The core function of this patch is fromFormatedString(string, format), it will construct a Data object based upon the string and format. Currently, support %m, %d, %Y, -- that is good enough for this widget. I would like to merge this functionality into dojo.date if required.

comment:4 Changed 13 years ago by liucougar

did anyone actually commit your patch?

if not, please reopen this bug

comment:5 Changed 13 years ago by Eugene Lazutkin

Priority: highnormal
Resolution: fixed
Status: closedreopened

It looks like it was incorrectly closed. I am reopening it.

comment:6 Changed 13 years ago by Eugene Lazutkin

Owner: changed from dylan to Eugene Lazutkin
Status: reopenednew

comment:7 Changed 13 years ago by Adam Peller

Formatting is probably best separated from the widget module. I'm actually (yes, finally :) working on this in dojo.i18n.datetime, and hope to have it ready soon, like in a week or two. You may assign this to me, if you like.

comment:8 Changed 13 years ago by Adam Peller

Owner: changed from Eugene Lazutkin to Adam Peller

Changed 13 years ago by Adam Peller

Attachment: dddp-i18n-r5597.patch added

Use dojo.date.format/dojo.date.parse to render and accept dates from the input widget in various formats

Changed 13 years ago by Adam Peller

new tests for localization

comment:9 Changed 13 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [5637]) DropdownDatePicker? handling of locale-based formatting and parsing of dates (fixes #1008, fixes #821) Use locale-independent serialization for dddp in a form (fixes #721) Removed experimental from dojo.date.parse (fixes #835)

comment:10 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.