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