4 console = { log: function() {} };
8 console.log("ready()");
10 /* Update date_input plugin so that MM/DD/YYYY format is used. */
11 $.extend(DateInput.DEFAULT_OPTS, {
12 stringToDate: function(string) {
14 if(matches = string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/)) {
15 return new Date(matches[3], matches[1] - 1, matches[2]);
20 dateToString: function(date) {
21 var month = (date.getMonth() + 1).toString();
22 var dom = date.getDate().toString();
23 if(month.length == 1) month = "0" + month;
24 if(dom.length == 1) dom = "0" + dom;
25 return month + "/" + dom + "/" + date.getFullYear();
29 /* Attach datepickers to fields! */
30 $('input.datepicker').date_input();
32 console.log("ready() done");