|
15 | 15 | bscss.prop('href', '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css');
|
16 | 16 | bsdpcss.prop('href', 'bootstrap-datepicker/css/datepicker.css');
|
17 | 17 | page.bootstrap = 2;
|
18 |
| - $(page).trigger('change:bootstrap', 2) |
19 | 18 | }
|
20 | 19 | else{
|
21 | 20 | bscss.prop('href', '//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css');
|
22 | 21 | bsdpcss.prop('href', 'bootstrap-datepicker/css/datepicker3.css');
|
23 | 22 | page.bootstrap = 3;
|
24 |
| - $(page).trigger('change:bootstrap', 3) |
25 | 23 | }
|
| 24 | + |
| 25 | + $(page).trigger('change:bootstrap', page.bootstrap); |
26 | 26 | }
|
27 | 27 | </script>
|
28 | 28 | <style>
|
@@ -232,6 +232,13 @@ <h2>bootstrap-datepicker sandbox <small>αlphα</small></h2>
|
232 | 232 | <option value="2">2 / years</option>
|
233 | 233 | </select>
|
234 | 234 | </label>
|
| 235 | + <label for="maxViewMode">Max view mode |
| 236 | + <select class="span2 col-md-2 form-control" id="maxViewMode" name="maxViewMode"> |
| 237 | + <option value="0">0 / days</option> |
| 238 | + <option value="1">1 / months</option> |
| 239 | + <option value="2" selected>2 / years</option> |
| 240 | + </select> |
| 241 | + </label> |
235 | 242 | <label for="todayBtn" class="inline checkbox">Today button
|
236 | 243 | <select class="span2 col-md-2 form-control" id="todayBtn" name="todayBtn">
|
237 | 244 | <option value="false">disabled</option>
|
@@ -295,6 +302,18 @@ <h2>bootstrap-datepicker sandbox <small>αlphα</small></h2>
|
295 | 302 |
|
296 | 303 | <br>
|
297 | 304 |
|
| 305 | + <span>Days of week highlighted: |
| 306 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="0"> 0</label> |
| 307 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="1"> 1</label> |
| 308 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="2"> 2</label> |
| 309 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="3"> 3</label> |
| 310 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="4"> 4</label> |
| 311 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="5"> 5</label> |
| 312 | + <label class="checkbox"><input type="checkbox" name="daysOfWeekHighlighted" value="6"> 6</label> |
| 313 | + </span> |
| 314 | + |
| 315 | + <br> |
| 316 | + |
298 | 317 | <label for="calendarWeeks" class="inline checkbox">
|
299 | 318 | <input id="calendarWeeks" name="calendarWeeks" type="checkbox">
|
300 | 319 | Calendar weeks
|
@@ -323,7 +342,11 @@ <h2>bootstrap-datepicker sandbox <small>αlphα</small></h2>
|
323 | 342 | <input id="beforeShowMonth" name="beforeShowMonth" type="checkbox">
|
324 | 343 | Before-show-month callback
|
325 | 344 | </label>
|
326 |
| - <label for="datesDisabled" class="inline checkbox"> |
| 345 | + <label for="beforeShowYear" class="inline checkbox"> |
| 346 | + <input id="beforeShowYear" name="beforeShowYear" type="checkbox"> |
| 347 | + Before-show-year callback |
| 348 | + </label> |
| 349 | + <label for="datesDisabled" class="inline checkbox"> |
327 | 350 | <input id="datesDisabled" name="datesDisabled" type="checkbox">
|
328 | 351 | datesDisabled
|
329 | 352 | </label>
|
@@ -387,29 +410,32 @@ <h2>bootstrap-datepicker sandbox <small>αlphα</small></h2>
|
387 | 410 | var js = "$('#sandbox-container "+selector+"').datepicker({\n",
|
388 | 411 | val;
|
389 | 412 | for (var opt in $.extend({}, defaults, values)){
|
390 |
| - console.log(opt); |
391 | 413 | if (values[opt] != defaults[opt]){
|
392 | 414 | val = values[opt];
|
393 |
| - if (opt == 'daysOfWeekDisabled') val = '"'+val+'"' |
| 415 | + if (opt == 'daysOfWeekDisabled' || opt == 'daysOfWeekHighlighted') val = '"'+val+'"' |
394 | 416 | else if (opt == 'beforeShowDay') val = function(date){
|
395 |
| - if (date.getMonth() == (new Date()).getMonth()) |
396 |
| - switch (date.getDate()){ |
397 |
| - case 4: |
398 |
| - return { |
399 |
| - tooltip: 'Example tooltip', |
400 |
| - classes: 'active' |
401 |
| - }; |
402 |
| - case 8: |
403 |
| - return false; |
404 |
| - case 12: |
405 |
| - return "green"; |
406 |
| - } |
407 |
| - } |
408 |
| - else if (opt == 'beforeShowMonth') val = function(date){ |
409 |
| - switch (date.getMonth()){ |
| 417 | + if (date.getMonth() == (new Date()).getMonth()) |
| 418 | + switch (date.getDate()){ |
| 419 | + case 4: |
| 420 | + return { |
| 421 | + tooltip: 'Example tooltip', |
| 422 | + classes: 'active' |
| 423 | + }; |
410 | 424 | case 8:
|
411 | 425 | return false;
|
412 |
| - } |
| 426 | + case 12: |
| 427 | + return "green"; |
| 428 | + } |
| 429 | + } |
| 430 | + else if (opt == 'beforeShowMonth') val = function(date){ |
| 431 | + if (date.getMonth() == 8) { |
| 432 | + return false; |
| 433 | + } |
| 434 | + } |
| 435 | + else if (opt == 'beforeShowYear') val = function(date){ |
| 436 | + if (date.getFullYear() == 2007) { |
| 437 | + return false; |
| 438 | + } |
413 | 439 | }
|
414 | 440 | else if (opt == 'datesDisabled'){
|
415 | 441 | var date = new Date();
|
|
0 commit comments