bgneal@312: $(document).ready(function() { bgneal@312: $('#id_start_date').datepicker({constrainInput: true, bgneal@312: dateFormat: 'mm/dd/yy', bgneal@312: onClose: function () { bgneal@312: var end = $('#id_end_date'); bgneal@312: if (this.value > end.val()) bgneal@312: { bgneal@312: end.val(this.value); bgneal@312: } bgneal@312: } bgneal@312: }); bgneal@312: $('#id_end_date').datepicker({constrainInput: true, bgneal@312: dateFormat: 'mm/dd/yy', bgneal@312: onClose: function () { bgneal@312: var start = $('#id_start_date'); bgneal@312: if (this.value < start.val()) bgneal@312: { bgneal@312: start.val(this.value); bgneal@312: } bgneal@312: } bgneal@312: }); bgneal@312: if ($('#id_all_day:checked').length) bgneal@312: { bgneal@312: $('#id_start_time').hide(); bgneal@312: $('#id_end_time').hide(); bgneal@312: $('#id_tz_stuff').hide(); bgneal@312: } bgneal@312: $('#id_all_day').click(function () { bgneal@312: $('#id_start_time').toggle(); bgneal@312: $('#id_end_time').toggle(); bgneal@312: $('#id_tz_stuff').toggle(); bgneal@312: }); bgneal@312: });