engineer9090909090909090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Patch to add dpClearSelected Method #220

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We are using datePicker with the multimonth extension, and needed a way to 
clear the calendars after selecting a bunch of dates. I added the following 
function and submit it here as a patch that could be added to the base.

/**
 * Deselects all dates on any matched element's date pickers. Very useful on date pickers where selectMultiple==true.
 *
 * @type jQuery
 * @name dpClearSelected
 * @cat plugins/datePicker
 * @author Kelvin Luck (http://www.kelvinluck.com/)
 *
 * @example $('.date-picker').datePicker();
 * $('.date-picker').dpClearSelected();
 * @desc Creates a date picker associated with all elements with a class of "date-picker" then clears all selected elements. Useful when calendar is inline, selectMultiple==true, and a button is created to clear all selected elements.
 **/
        dpClearSelected : function()
        {
           return _w.call(this, 'clearSelected');
        },

Original issue reported on code.google.com by dthomp...@gmail.com on 2 Jul 2010 at 4:17

GoogleCodeExporter commented 8 years ago
I am allowing users to select multiple dates based on month by date and 
annually by date as well as other selector onchange events. When 'month by 
date' is chosen and the user selects one or more dates and then changes his 
mind to choose 'annually by date', the dates that he had already chosen show up 
on that calendar as well. I want to clear selectedDates completely with a 
selector onchange. 

Original comment by vasseur....@gmail.com on 19 Aug 2014 at 6:11

GoogleCodeExporter commented 8 years ago
The code looks good to me... Sorry I missed it back in 2010!

Could you please submit it as a pull request against the github repository 
where the plugin now lives?

https://github.com/vitch/jQuery-datepicker

Thanks!

Original comment by kelvin.l...@gmail.com on 20 Aug 2014 at 7:33

GoogleCodeExporter commented 8 years ago
Pull request made!

Original comment by dthomp...@gmail.com on 23 Aug 2014 at 3:53