Skip to content

Commit e2342ed

Browse files
committed
Merge pull request uxsolutions#1206 from acrobat/beforeShowMonth-docs
Added example for beforeShowMonth callback added in uxsolutions#1074
2 parents de72d06 + 1e1a37a commit e2342ed

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

index.htm

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ <h2>bootstrap-datepicker sandbox <small>&alpha;lph&alpha;</small></h2>
319319
<input id="beforeShowDay" name="beforeShowDay" type="checkbox">
320320
Before-show-day callback
321321
</label>
322+
<label for="beforeShowMonth" class="inline checkbox">
323+
<input id="beforeShowMonth" name="beforeShowMonth" type="checkbox">
324+
Before-show-month callback
325+
</label>
322326

323327
<br></br>
324328

@@ -375,19 +379,25 @@ <h2>bootstrap-datepicker sandbox <small>&alpha;lph&alpha;</small></h2>
375379
val = values[opt];
376380
if (opt == 'daysOfWeekDisabled') val = '"'+val+'"'
377381
else if (opt == 'beforeShowDay') val = function(date){
378-
if (date.getMonth() == (new Date()).getMonth())
379-
switch (date.getDate()){
380-
case 4:
381-
return {
382-
tooltip: 'Example tooltip',
383-
classes: 'active'
384-
};
385-
case 8:
386-
return false;
387-
case 12:
388-
return "green";
389-
}
390-
}
382+
if (date.getMonth() == (new Date()).getMonth())
383+
switch (date.getDate()){
384+
case 4:
385+
return {
386+
tooltip: 'Example tooltip',
387+
classes: 'active'
388+
};
389+
case 8:
390+
return false;
391+
case 12:
392+
return "green";
393+
}
394+
}
395+
else if (opt == 'beforeShowMonth') val = function(date){
396+
switch (date.getMonth()){
397+
case 8:
398+
return false;
399+
}
400+
}
391401
else if (val == 'on' || val == 'true') val = 'true';
392402
else if (val === void 0 || val == 'false') val = 'false';
393403
else if (parseInt(val) == val) val = val;

0 commit comments

Comments
 (0)