| 1 |
<?php |
| 2 |
|
| 3 |
?> |
| 4 |
<script type="text/javascript"> |
| 5 |
jQuery(function($) { |
| 6 |
$('.date-pick').each(function() { |
| 7 |
var format = $(this).data('format') || 'mm/dd/yyyy'; |
| 8 |
format = format.replace(/yyyy/i, 'yy'); |
| 9 |
$(this).datepicker({ |
| 10 |
autoFocusNextInput: true, |
| 11 |
constrainInput: false, |
| 12 |
changeMonth: true, |
| 13 |
changeYear: true, |
| 14 |
beforeShow: function(input, inst) { $('#ui-datepicker-div').addClass('show'); }, |
| 15 |
dateFormat: format.toLowerCase(), |
| 16 |
}); |
| 17 |
}); |
| 18 |
d = new Date(); |
| 19 |
$('.birthdate-pick').each(function() { |
| 20 |
var format = $(this).data('format') || 'mm/dd'; |
| 21 |
format = format.replace(/yyyy/i, 'yy'); |
| 22 |
$(this).datepicker({ |
| 23 |
autoFocusNextInput: true, |
| 24 |
constrainInput: false, |
| 25 |
changeMonth: true, |
| 26 |
changeYear: false, |
| 27 |
minDate: new Date(d.getFullYear(), 1-1, 1), |
| 28 |
maxDate: new Date(d.getFullYear(), 12-1, 31), |
| 29 |
beforeShow: function(input, inst) { $('#ui-datepicker-div').removeClass('show'); }, |
| 30 |
dateFormat: format.toLowerCase(), |
| 31 |
}); |
| 32 |
|
| 33 |
}); |
| 34 |
|
| 35 |
}); |
| 36 |
</script> |
| 37 |
|