@singularsystems/neo-core 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -352,7 +352,8 @@ var DatePicker = /** @class */ (function () {
|
|
|
352
352
|
var cell = this.createAndAppend(trBody, "td");
|
|
353
353
|
var date = currentDate.getDate();
|
|
354
354
|
var month = currentDate.getMonth();
|
|
355
|
-
|
|
355
|
+
var canSelect = this.options.canSelectDate ? this.options.canSelectDate(currentDate) : true;
|
|
356
|
+
this.setupCell(cell, date.toString(), currentDate.getFullYear() + "," + month + "," + date, canSelect && currentDate.getTime() >= this.options.minDateNoTime.getTime() && currentDate.getTime() <= this.options.maxDateNoTime.getTime(), currentDate.getTime() == this.today.getTime(), this.boundDateNoTime != null && currentDate.getTime() == this.boundDateNoTime.getTime());
|
|
356
357
|
if (month != this.currentViewDate.getMonth()) {
|
|
357
358
|
cell.classList.add("outside-month");
|
|
358
359
|
}
|
|
@@ -17,6 +17,11 @@ export default class DatePickerOptions {
|
|
|
17
17
|
showInput: boolean;
|
|
18
18
|
minDate: Date;
|
|
19
19
|
maxDate: Date;
|
|
20
|
+
/**
|
|
21
|
+
* A function that returns true if the date can be selected in the date picker.
|
|
22
|
+
* **NOTE:** this will not prevent the date from being typed in. You must also add a validation rule to the bound property.
|
|
23
|
+
*/
|
|
24
|
+
canSelectDate?: (date: Date) => boolean;
|
|
20
25
|
/** Automatically sets the date to the start or end of the displayed month when scrolling through months. */
|
|
21
26
|
autoChangeDate: AutoChangeType;
|
|
22
27
|
/** The number of years to show before the current year when in the year view. 16 years are shown in total. */
|