Created
June 25, 2015 12:09
-
-
Save swapnilshrikhande/251c97306176bee9391d to your computer and use it in GitHub Desktop.
jQuery Datepicker Day by Day disable dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#nationalPicker').datepick({ | |
onDate: nationalDays, showTrigger: '#calImg'}); | |
var natDays = [[1, 26, 'au', 'Australia'], [2, 6, 'nz', 'New Zealand'], | |
[3, 17, 'ie', 'Ireland'], [4, 27, 'za', 'South Africa'], | |
[5, 25, 'ar', 'Argentina'], [6, 6, 'se', 'Sweden'], | |
[7, 4, 'us', 'United States'], [8, 17, 'id', 'Indonesia'], | |
[9, 7, 'br', 'Brazil'], [10, 1, 'cn', 'China'], | |
[11, 22, 'lb', 'Lebanon'], [12, 12, 'ke', 'Kenya']]; | |
function nationalDays(date, inMonth) { | |
if (inMonth) { | |
for (i = 0; i < natDays.length; i++) { | |
if (date.getMonth() + 1 == natDays[i][0] && | |
date.getDate() == natDays[i][1]) { | |
return {dateClass: natDays[i][2] + '_day', | |
selectable: false, title: natDays[i][3]}; | |
} | |
} | |
} | |
return {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment