r80835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80834‎ | r80835 | r80836 >
Date:20:38, 23 January 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
fix bug 26711: DatePicker: DisabledDates and HighlightedDates now working in IE
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/libs/datepicker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/libs/datepicker.js
@@ -79,21 +79,33 @@
8080 }
8181
8282 if ( params.disabledDates ) {
 83+
 84+ var disabledDates = new Array();
8385
84 - var disabledDates = params.disabledDates.map(function(range) {
85 - return [new Date(range[0], range[1], range[2]), new Date(range[3], range[4], range[5])]
86 - });
 86+ for (i in params.disabledDates)
 87+ disabledDates.push([
 88+ new Date(params.disabledDates[i][0], params.disabledDates[i][1], params.disabledDates[i][2]),
 89+ new Date(params.disabledDates[i][3], params.disabledDates[i][4], params.disabledDates[i][5])
 90+ ]);
8791
8892 input.datepicker("option", "disabledDates", disabledDates);
 93+
 94+ delete disabledDates;
8995 }
9096
9197 if ( params.highlightedDates ) {
9298
93 - var highlightedDates = params.highlightedDates.map(function(range) {
94 - return [new Date(range[0], range[1], range[2]), new Date(range[3], range[4], range[5])]
95 - });
 99+ var highlightedDates = new Array();
96100
 101+ for (i in params.highlightedDates)
 102+ highlightedDates.push([
 103+ new Date(params.highlightedDates[i][0], params.highlightedDates[i][1], params.highlightedDates[i][2]),
 104+ new Date(params.highlightedDates[i][3], params.highlightedDates[i][4], params.highlightedDates[i][5])
 105+ ]);
 106+
97107 input.datepicker("option", "highlightedDates", highlightedDates);
 108+
 109+ delete highlightedDates;
98110 }
99111
100112 if (params.disabledDays) {