Mercurial > public > sg101
annotate media/js/gcalendar.js @ 77:d5eed0a91a05
#24 - Make the default date for a birthday today - 30 years. This allows you to select any month with the picker if the field is initially blank.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 10 Jul 2009 23:56:02 +0000 |
parents | c0d3b09c9b95 |
children | 5b69d6e01fd4 |
rev | line source |
---|---|
gremmie@1 | 1 $(document).ready(function() { |
gremmie@1 | 2 $('#id_description').markItUp(mySettings); |
gremmie@1 | 3 $('#id_start_date').datepicker({constrainInput: true, |
gremmie@1 | 4 onClose: function () { |
gremmie@1 | 5 var end = $('#id_end_date'); |
gremmie@1 | 6 if (this.value > end.val()) |
gremmie@1 | 7 { |
gremmie@1 | 8 end.val(this.value); |
gremmie@1 | 9 } |
gremmie@1 | 10 } |
gremmie@1 | 11 }); |
gremmie@1 | 12 $('#id_end_date').datepicker({constrainInput: true, |
gremmie@1 | 13 onClose: function () { |
gremmie@1 | 14 var start = $('#id_start_date'); |
gremmie@1 | 15 if (this.value < start.val()) |
gremmie@1 | 16 { |
gremmie@1 | 17 start.val(this.value); |
gremmie@1 | 18 } |
gremmie@1 | 19 } |
gremmie@1 | 20 }); |
gremmie@1 | 21 if ($('#id_all_day:checked').length) |
gremmie@1 | 22 { |
gremmie@1 | 23 $('#id_start_time').hide(); |
gremmie@1 | 24 $('#id_end_time').hide(); |
gremmie@1 | 25 $('#id_tz_stuff').hide(); |
gremmie@1 | 26 } |
gremmie@1 | 27 $('#id_all_day').click(function () { |
gremmie@1 | 28 $('#id_start_time').toggle(); |
gremmie@1 | 29 $('#id_end_time').toggle(); |
gremmie@1 | 30 $('#id_tz_stuff').toggle(); |
gremmie@1 | 31 }); |
gremmie@1 | 32 }); |