Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#2832 closed bug (fixed)

Datepicker v3.4.3 $(element).datepicker('getDate') doesn't work properly

Reported by: insekticid Owned by: iMarc
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: datepicker Cc:
Blocked by: Blocking:

Description

When I enter any date into datepicker input and then I want to get this date with function $(element).datepicker('getDate') I always get "null".

I studied the code and I found this: date from input is parsed only when I opened datepicker!

So now I am using this ugly hack

$(element).datepicker("show"); $(element).datepicker("hide"); parsed = $(element).datepicker('getDate');

Attachments (2)

datepicker.2.patch (2.1 KB) - added by insekticid 12 years ago.
patch v2.0
datepicker.patch (2.1 KB) - added by insekticid 12 years ago.
patch v2

Download all attachments as: .zip

Change History (9)

comment:1 Changed 12 years ago by paul

Priority: criticalmajor

comment:2 Changed 12 years ago by paul

Owner: changed from paul to iMarc

comment:3 Changed 12 years ago by insekticid

Hello, here is my hotfix + I added new method for checking, if entered date is in allowed range

Changed 12 years ago by insekticid

Attachment: datepicker.2.patch added

patch v2.0

Changed 12 years ago by insekticid

Attachment: datepicker.patch added

patch v2

comment:4 Changed 12 years ago by insekticid

new methods: isMaxDate, isMinDate

patch v2.0 is the same like patch v2

now It is possible to validate Datepicker dates with validate plugin

$.validator.methods.dateMin = function (value, element, param) {

return $(element).datepicker('isMinDate');

};

$.validator.methods.dateMax = function (value, element, param) {

return $(element).datepicker('isMaxDate');

};

$.validator.methods.dateRange = function (value, element, param) {

return $(element).datepicker('isDateInRange');

};

comment:5 Changed 12 years ago by insekticid

new version of my patch (new enhancement request)

http://dev.jquery.com/ticket/2991

comment:6 Changed 12 years ago by insekticid

so you can close this bug

it has been fixed in revision 125 ;-) thx

comment:7 Changed 12 years ago by flesler

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.