Search and Top Navigation
#5793 closed bug (notabug)
Opened July 03, 2010 11:57PM UTC
Closed October 11, 2012 06:57PM UTC
Last modified October 11, 2012 09:15PM UTC
Datepicker + Masked Input
Reported by: | marcos.pont | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.datepicker | Version: | 1.8.2 |
Keywords: | parseDate, updateDatePicker, masked input | Cc: | |
Blocked by: | Blocking: |
Description
When using Datepicker with Masked Input plugin, the input value is cleared out when the user types a date value.
This happens because JUI Datepicker considers dates with 2 digit year as valid dates inside the parseDate method.
So, if a valid date is found (for instance, 07/04/10), the _updateDatePicker method is called and then the native focus() function is called on the input.
This calls the focus handler on Masked Input plugin. If the mask defined for the field expects year with 4 digits, the 2 digit year will make the date invalid and the input will be cleared out.
My suggestion is: is it possible for Datepicker to accept years with 2 digits based on a configuration setting? This would help developers using Datepicker and Masked Input to make them work together.
I have tried to think of a solution that would change Masked Input's code, but I couldn't. Since the entered value is not a full date, it does not respect the defined mask and there's no workaround for this.
Thanks in advance!
Attachments (0)
Change History (4)
Changed July 04, 2010 12:20AM UTC by comment:1
Changed September 16, 2010 04:56PM UTC by comment:2
Hi,
After having same problem (Datepicker + Masked Input), I just removed the call to focus() at the end of _updateDatepicker() and I'm very happy with this new behavior.
For me, leaving updateDatepicker() without calling focus() at all is quite acceptable.
Changed October 11, 2012 06:57PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | new → closed |
The datepicker supports specifying a date format. This is definitely not a bug in datepicker.
Changed October 11, 2012 09:15PM UTC by comment:4
milestone: | TBD |
---|
Milestone TBD deleted
I have made more research on how to find a fix for this issue.
In order to make Datepicker work with Masked Input plugin, we would need 2 things: