From a3d0b1df27a7498a24b36bb805a3f515869f5fdd Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 11 Jul 2010 13:25:02 +0100 Subject: bring back the jquerytools calendar --- index.html | 38 +++++++++++++++++++++++++------------- jarmon.js | 28 +++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 3d4a302..7e0ac97 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + @@ -110,16 +110,28 @@ } $(function() { - // Add dhtml calendars to the date input fields - /* - $(":date").dateinput({format: 'mmm dd yyyy', max: +1}); - $(":date[name=startTime]").data("dateinput").change(function() { - $(":date[name=endTime]").data("dateinput").setMin(this.getValue(), true); - }); - $(":date[name=endTime]").data("dateinput").change(function() { - $(":date[name=startTime]").data("dateinput").setMax(this.getValue(), true); - }); - */ + + // Add dhtml calendars to the date input fields + $(".timerange_control.custom input") + .dateinput({ + 'format': 'dd mmm yyyy 00:00:00', + 'max': +1, + 'css': {'input': 'jquerytools_date'}}) + .bind('onBeforeShow', function(e) { + $(this).data('dateinput').setValue(new Date(this.value)); + }); + $(".timerange_control.custom input").bind('onHide', + function(e) { + $(this).trigger('change'); + }); + + $(":date[name=from_custom]").data("dateinput").change(function() { + $(":date[name=to_custom]").data("dateinput").setMin(this.getValue(), true); + }); + $(":date[name=to_custom]").data("dateinput").change(function() { + $(":date[name=from_custom]").data("dateinput").setMax(this.getValue(), true); + }); + // Setup dhtml tabs $(".css-tabs").tabs(".css-panes > div", {history: true}); @@ -141,8 +153,8 @@
- - + +