]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/public/js/admin.js
Use jqueryui instead of some non-core date picker module.
[bluechips.git] / bluechips / public / js / admin.js
index 00b2e3df98cab300cc53a6f6da3e67fd25c7ee89..4a115015402d328b0baccf9f05303ed3099bcb9c 100644 (file)
@@ -7,27 +7,13 @@ try {
 $(function() {
     console.log("ready()");
    
-    /* Update date_input plugin so that MM/DD/YYYY format is used. */
-    $.extend(DateInput.DEFAULT_OPTS, {
-        stringToDate: function(string) {
-            var matches;
-            if(matches = string.match(/^(\d{2,2})\/(\d{2,2})\/(\d{4,4})$/)) {
-                return new Date(matches[3], matches[1] - 1, matches[2]);
-            } else {
-                return null;
-            }
-        },
-        dateToString: function(date) {
-            var month = (date.getMonth() + 1).toString();
-            var dom = date.getDate().toString();
-            if(month.length == 1) month = "0" + month;
-            if(dom.length == 1) dom = "0" + dom;
-            return month + "/" + dom + "/" + date.getFullYear();
-        }
-    });
-
     /* Attach datepickers to fields! */
-    $('input.datepicker').date_input();
+    $('input.datepicker').datepicker({
+        changeMonth: true,
+        changeYear: true,
+        duration: '',
+        showButtonPanel: true,
+    });
 
     console.log("ready() done");
 });