view gcalendar/static/js/gcalendar.js @ 997:19b86e684cc2

WIP on news v2.0. Initial model changes and submit news functions.
author Brian Neal <bgneal@gmail.com>
date Tue, 17 Nov 2015 21:01:20 -0600
parents ee87ea74d46b
children 110bbc78a482
line wrap: on
line source
$(document).ready(function() {
    $('#id_start_date').datepicker({constrainInput: true, 
       dateFormat: 'mm/dd/yy',
       onClose: function () {
         var end = $('#id_end_date');
         if (this.value > end.val())
         {
            end.val(this.value);
         }
       }
       });
    $('#id_end_date').datepicker({constrainInput: true,
       dateFormat: 'mm/dd/yy',
       onClose: function () {
         var start = $('#id_start_date');
         if (this.value < start.val())
         {
            start.val(this.value);
         }
       }
       });
    if ($('#id_all_day:checked').length)
    {
       $('#id_start_time').hide();
       $('#id_end_time').hide();
       $('#id_tz_stuff').hide();
    }
    $('#id_all_day').click(function () {
       $('#id_start_time').toggle();
       $('#id_end_time').toggle();
       $('#id_tz_stuff').toggle();
       });
});