diff --git a/javascript/CalendarDateField.js b/javascript/CalendarDateField.js index 96339f33e..1014ab3d9 100755 --- a/javascript/CalendarDateField.js +++ b/javascript/CalendarDateField.js @@ -6,15 +6,17 @@ * * @author Ingo Schommer, SilverStripe Ltd. */ - $('.calendardate').concrete('ss', { - onmatch: function() { - this.find('input').each(function() { - var conf = $(this).metadata(); - if(conf.minDate) conf.minDate = new Date(Date.parse(conf.minDate)); + $('.calendardate').concrete('ss', function($){ + return { + onmatch: function() { + this.find('input').each(function() { + var conf = $(this).metadata(); + if(conf.minDate) conf.minDate = new Date(Date.parse(conf.minDate)); - // - $(this).datepicker(conf); - }); - } - }) + // + $(this).datepicker(conf); + }); + } + }; + }); }(jQuery)); \ No newline at end of file