comparison media/js/gcalendar.js @ 198:7e3ed3eb9b99

Fix #71: problems with editing existing gcalendar dates; the date format wasn't what the datepicker expected.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Apr 2010 17:58:09 +0000
parents 4e1abeb593c2
children
comparison
equal deleted inserted replaced
197:2baadae33f2e 198:7e3ed3eb9b99
1 $(document).ready(function() { 1 $(document).ready(function() {
2 $('#id_start_date').datepicker({constrainInput: true, 2 $('#id_start_date').datepicker({constrainInput: true,
3 dateFormat: 'yy-mm-dd', 3 dateFormat: 'mm/dd/yy',
4 onClose: function () { 4 onClose: function () {
5 var end = $('#id_end_date'); 5 var end = $('#id_end_date');
6 if (this.value > end.val()) 6 if (this.value > end.val())
7 { 7 {
8 end.val(this.value); 8 end.val(this.value);
9 } 9 }
10 } 10 }
11 }); 11 });
12 $('#id_end_date').datepicker({constrainInput: true, 12 $('#id_end_date').datepicker({constrainInput: true,
13 dateFormat: 'yy-mm-dd', 13 dateFormat: 'mm/dd/yy',
14 onClose: function () { 14 onClose: function () {
15 var start = $('#id_start_date'); 15 var start = $('#id_start_date');
16 if (this.value < start.val()) 16 if (this.value < start.val())
17 { 17 {
18 start.val(this.value); 18 start.val(this.value);