Created
August 17, 2011 09:37
-
-
Save trylik/1151195 to your computer and use it in GitHub Desktop.
Example jquery Ui datepicker
This file contains 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
// date picker | |
$(function() { | |
var dates = $( "#from, #to" ).datepicker({ | |
defaultDate: "+1w", | |
changeMonth: true, | |
numberOfMonths: 3, | |
firstDay: 1, | |
dayNamesMin: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], | |
monthNames: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'], | |
monthNamesShort: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'], | |
nextText: "Następny", | |
prevText: "Poprzedni", | |
onSelect: function( selectedDate ) { | |
var option = this.id == "from" ? "minDate" : "maxDate", | |
instance = $( this ).data( "datepicker" ), | |
date = $.datepicker.parseDate( | |
instance.settings.dateFormat || | |
$.datepicker._defaults.dateFormat, | |
selectedDate, instance.settings ); | |
dates.not( this ).datepicker( "option", option, date ); | |
}, | |
onClose: function(dateText, inst) { | |
reloadTable(); | |
} | |
}); | |
$('#from, #to').datepicker('option', 'dateFormat', 'dd.mm.yy'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment