Opened 13 years ago

Closed 13 years ago

#835 closed enhancement (fixed)

Date format from string to date object

Reported by: joose@… Owned by: Adam Peller
Priority: high Milestone: 0.9
Component: General Version: 0.3
Keywords: dojo.date.format Cc: joose@…, l.stancapiano@…
Blocked By: Blocking:

Description

In dojo.date we have: dojo.date.format = dojo.date.strftime = function (dateObject, format) {

but what is missing, is same but from string to dateObject.. so like:

dojo.date.fromString = function (dateString, format) {

implementation return dateObject;

}

with this, dropdowndatepicker could set it's date from userInput and also validating would be easy.

Change History (7)

comment:1 Changed 13 years ago by anonymous

Cc: l.stancapiano@… added

comment:2 Changed 13 years ago by jan831@…

Type: defectenhancement

maybe it's good to define 2 constants, indication the minimum & maximum year.

this is usefull to parse years with only 2 digits

e.g. dojo.date.minYear = 1970; dojo.date.maxYear = 2050;

with format %m/%d/%y

01/25/06 = January 25, 2006 (not January 25, 1906)

comment:3 Changed 13 years ago by dylan

Milestone: 0.5
Owner: changed from anonymous to dylan
Status: newassigned

comment:4 Changed 13 years ago by Adam Peller

Owner: changed from dylan to Adam Peller
Status: assignednew

comment:5 Changed 13 years ago by Adam Peller

see dojo.i18n.datetime.parse. This will be based on Java DateFormat?-like syntax rather than the posix strftime() style.

comment:6 Changed 13 years ago by Adam Peller

Status: newassigned

refactored. see dojo.date.parse in src/date/format.js. It's a work in progress, but should be able to handle simple numeric formatted dates along with some locale-based defaults

comment:7 Changed 13 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

(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)

Note: See TracTickets for help on using tickets.