Opened 11 years ago
Last modified 9 years ago
#7786 open bug
Insertion of invalid number is converted to currentDate but only in first time
Reported by: | sestrela | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.8.16 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello
I found a behavior in datepicker that, seems to me, its a bug. It manifests itself even in the documentation page http://jqueryui.com/demos/datepicker/#default.
When I access the url above for the first time, enter 11111 in the textbox and press enter key, the default date, aka today's date is shown. Then, I clear it, enter 11111 again, press enter key and nothing happens. I refresh the page and it happens again.
What I really wanted to happen was that the value 11111 was cleared automatacly, because it is an invalid date. But i think that, at least, the behavior should always be the same, so if the default date is showned in first access, the default date should always be showned.
Thank you for the great components.
Change History (6)
comment:1 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:2 Changed 10 years ago by
Status: | new → open |
---|
comment:3 Changed 10 years ago by
comment:4 Changed 9 years ago by
Milestone: | 1.11.0 → none |
---|
comment:5 follow-up: 6 Changed 9 years ago by
I don't see the inconsistent behaviour, for me, date picker *always* returns today for invalid dates.
I don't know how such an issue has been ignored for so long. It seems impossible to use a JQ UI date-picker in any useful way. If the user types nonsense into my field and I ask for the date; I shouldn't just be given an essentially random date and have no way of knowing that's actually what the user typed or not. No user would ever expect my system to do that.
How do the authors intend for this to be used? There's nothing in the docs suggesting there's another way of testing for validity, short of doing your own date parsing (which seems like a ridiculous duplication of effort).
comment:6 Changed 9 years ago by
Replying to DanTup:
I don't see the inconsistent behaviour, for me, date picker *always* returns today for invalid dates.
I don't know how such an issue has been ignored for so long. It seems impossible to use a JQ UI date-picker in any useful way. If the user types nonsense into my field and I ask for the date; I shouldn't just be given an essentially random date and have no way of knowing that's actually what the user typed or not. No user would ever expect my system to do that.
How do the authors intend for this to be used? There's nothing in the docs suggesting there's another way of testing for validity, short of doing your own date parsing (which seems like a ridiculous duplication of effort).
Here's an example of the sort of thing that you can do: http://jsfiddle.net/tj_vantoll/vyj5eesh/. The datepicker rewrite will have an isValid()
method to simplify this.
#8009 is a duplicate of this ticket.