Skip to main content

Search and Top Navigation

#2933 closed feature (wontfix)

Opened June 02, 2008 03:53AM UTC

Closed October 26, 2010 03:07AM UTC

Last modified October 03, 2012 04:44PM UTC

isMinDate, isMaxDate and isDateInRange getter functions

Reported by: grabanski Owned by:
Priority: minor Milestone: 1.6
Component: ui.datepicker Version: 1.5
Keywords: Cc:
Blocked by: Blocking:
Description

moved from ticket #2832

User proposed adding the following functions:

$(element).datepicker('isMinDate');
$(element).datepicker('isMaxDate');
$(element).datepicker('isDateInRange');
Attachments (3)
Change History (12)

Changed June 02, 2008 09:50AM UTC by scottgonzalez comment:1

description: moved from ticket #2832 \ \ User proposed adding the following functions: \ \ $(element).datepicker('isMinDate'); \ $(element).datepicker('isMaxDate'); \ $(element).datepicker('isDateInRange'); \ moved from ticket #2832 \ \ User proposed adding the following functions: \ {{{ \ $(element).datepicker('isMinDate'); \ $(element).datepicker('isMaxDate'); \ $(element).datepicker('isDateInRange'); \ }}}

Changed June 06, 2008 02:25PM UTC by insekticid comment:2

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

;-)

attachment datepicker_rev170_enhancements.patch added

Changed June 17, 2008 11:45AM UTC by kbwood comment:3

What is the purpose of these functions? As provided isMinDate returns true if there is no minimum date or the current date is greater than or equal to the minimum!

Changed June 25, 2008 12:04AM UTC by paul comment:4

version: → 1.5

Changed July 07, 2008 09:02PM UTC by paul comment:5

owner: → kbwood
status: newassigned

Changed October 20, 2008 06:10PM UTC by jzaefferer comment:6

milestone: 1.61.7

Deferred, unclear usecase.

Changed November 13, 2008 01:46PM UTC by insekticid comment:7

using examples

jQuery.validator.addMethod("dateMin",

function (value, element, param)

{

if (value == "" || !param) return true;

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

}, "Please enter valid date."

);

jQuery.validator.addMethod("dateMax",

function (value, element, param)

{

if (value == "" || !param) return true;

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

}, "Please enter valid date."

);

jQuery.validator.addMethod("k2dateRange",

function (value, element, param)

{

if (value == "" || !param) return true;

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

}, "Please enter valid date."

);

jQuery.validator.addMethod("k2date",

function(value, element, param)

{

if (!param) return true; // needed for validatorCondition to work

return this.optional(element) || $(element).datepicker('isValidDate');

}, "Please enter a valid date."

);

example 2 - datepicker ranges

$('d_start_from').datepicker({'minDate':$.datepicker.parseDate("yy-mm-dd", "2008-11-13"),'beforeShow':function () { return {'maxDate':$("#d_end_to").datepicker("getMinMaxRangeDate", "max")}; }});

$('d_end_to').datepicker({'maxDate':$.datepicker.parseDate("yy-mm-dd", "2010-12-31"),'beforeShow':function () { return {'minDate':$("#d_start_from").datepicker("getMinMaxRangeDate", "min")}; }});

your custom range example is not ok, when datepickers have date limits

code from example

function customRange(input) {

return {minDate: (input.id == "endDate" ? $("#startDate").datepicker("getDate") : null),

maxDate: (input.id == "startDate" ? $("#endDate").datepicker("getDate") : null)};

)

Changed November 13, 2008 01:55PM UTC by insekticid comment:8

you can check it at http://www.invia.cz/

Changed March 19, 2009 10:27AM UTC by kbwood comment:9

See the datepicker validation module at http://keith-wood.name/datepick.html.

Changed March 19, 2009 10:28AM UTC by kbwood comment:10

owner: kbwood

Changed October 26, 2010 03:07AM UTC by scottgonzalez comment:11

resolution: → wontfix
status: assignedclosed

These can be implemented as extensions.

Changed October 03, 2012 04:44PM UTC by scottgonzalez comment:12

milestone: 1.next1.6