Opened 15 years ago
Closed 14 years ago
#835 closed enhancement (fixed)
Date format from string to date object
Reported by: | Owned by: | Adam Peller | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | General | Version: | 0.3 |
Keywords: | dojo.date.format | Cc: | [email protected]…, [email protected]… |
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 15 years ago by
Cc: | [email protected]… added |
---|
comment:2 Changed 15 years ago by
Type: | defect → enhancement |
---|
comment:3 Changed 15 years ago by
Milestone: | → 0.5 |
---|---|
Owner: | changed from anonymous to dylan |
Status: | new → assigned |
comment:4 Changed 15 years ago by
Owner: | changed from dylan to Adam Peller |
---|---|
Status: | assigned → new |
comment:5 Changed 15 years ago by
see dojo.i18n.datetime.parse. This will be based on Java DateFormat?-like syntax rather than the posix strftime() style.
comment:6 Changed 15 years ago by
Status: | new → assigned |
---|
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 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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)