Opened 14 years ago
Closed 14 years ago
#3968 closed defect (fixed)
parser.js ignoring value="" for dates
Reported by: | haysmark | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Parser | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
The parser evaluates this DateTextbox?:
<input id="q14" type="text" dojoType="dijit.form.DateTextbox" value="">
However, instead of using the value of "", the parser ignores the "" and DateTextbox? gets the default class value: a new date. The parser doesn't even go into str2obj, like it does for nonblank values.
Change History (4)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | parser.js sends fromISOString invalid ISO string → parser.js ignoring value="" for dates |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
This is a bit bigger issue because in the same way that
<input dojoType=dijit.form.DateTextBox value="">
should be a blank/null/invalid date rather than today's date, also
new dijit.form.DateTextBox();
should be a blank/null/invalid date.
My first instinct is in the prototype to set
value:null
but that doesn't work because then the parser doesn't know that value is of type Date.
So it looks like the solution is to use the NaN of Dates, which can be achieved by new Date("") or new Date("xxx")
I'll look at the parser code and make sure that str2obj gets called for "" and that it instantiates an NaN Date.
Also was talk about making value="now" in the parser evaluate to the current date.
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Investigate the correct behavior of this code:
attrValue is "", so if(attrValue) returns false even though it is a valid value.