Index: trunk/extensions/SemanticFormsInputs/libs/datepicker.js |
— | — | @@ -79,21 +79,33 @@ |
80 | 80 | } |
81 | 81 | |
82 | 82 | if ( params.disabledDates ) { |
| 83 | + |
| 84 | + var disabledDates = new Array(); |
83 | 85 | |
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 | + ]); |
87 | 91 | |
88 | 92 | input.datepicker("option", "disabledDates", disabledDates); |
| 93 | + |
| 94 | + delete disabledDates; |
89 | 95 | } |
90 | 96 | |
91 | 97 | if ( params.highlightedDates ) { |
92 | 98 | |
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(); |
96 | 100 | |
| 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 | + |
97 | 107 | input.datepicker("option", "highlightedDates", highlightedDates); |
| 108 | + |
| 109 | + delete highlightedDates; |
98 | 110 | } |
99 | 111 | |
100 | 112 | if (params.disabledDays) { |