Bug Tracker

Modify

Ticket #2832 (closed bug: fixed)

Opened 5 years ago

Last modified 14 months ago

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:
Blocking: Blocked by:

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

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

Change History

comment:1 Changed 5 years ago by paul

  • Priority changed from critical to major

comment:2 Changed 5 years ago by paul

  • Owner changed from paul to iMarc

comment:3 Changed 5 years ago by insekticid

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

Changed 5 years ago by insekticid

patch v2.0

Changed 5 years ago by insekticid

patch v2

comment:4 Changed 5 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 5 years ago by insekticid

new version of my patch (new enhancement request)

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

comment:6 Changed 5 years ago by insekticid

so you can close this bug

it has been fixed in revision 125 ;-) thx

comment:7 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.