1 <script type="text/javascript">
3 /* Instead of including multiple localization files as you would normally see with
4 jQueryUI we expose the localization strings in the default configuration */
6 $.datepicker.regional[''] = {
10 currentText: _('Today'),
11 monthNames: [_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),
12 _('July'),_('August'),_('September'),_('October'),_('November'),_('December')],
13 monthNamesShort: [_('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'),
14 _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec')],
15 dayNames: [_('Sunday'), _('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday')],
16 dayNamesShort: [_('Sun'), _('Mon'), _('Tue'), _('Wed'), _('Thu'), _('Fri'), _('Sat')],
17 dayNamesMin: [_('Su'),_('Mo'),_('Tu'),_('We'),_('Th'),_('Fr'),_('Sa')],
19 dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
20 firstDay: [% CalendarFirstDayOfWeek %],
21 isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
22 showMonthAfterYear: false,
24 $.datepicker.setDefaults($.datepicker.regional['']);
27 $(document).ready(function(){
29 $.datepicker.setDefaults({
33 buttonImage: '[% interface %]/[% theme %]/img/famfamfam/silk/calendar.png',
34 buttonImageOnly: true,
35 showButtonPanel: true,
36 showOtherMonths: true,
37 selectOtherMonths: true
40 $( ".datepicker" ).datepicker();
41 // http://jqueryui.com/demos/datepicker/#date-range
42 var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
45 onSelect: function( selectedDate ) {
46 var option = this.id == "from" ? "minDate" : "maxDate",
47 instance = $( this ).data( "datepicker" );
48 date = $.datepicker.parseDate(
49 instance.settings.dateFormat ||
50 $.datepicker._defaults.dateFormat,
51 selectedDate, instance.settings );
52 dates.not( this ).datepicker( "option", option, date );