@singularsystems/neo-core 1.2.1 → 1.2.3

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
- this.setupCell(cell, date.toString(), currentDate.getFullYear() + "," + month + "," + date, 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());
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. */
@@ -76,7 +76,7 @@ var PropertyInfo = /** @class */ (function () {
76
76
  };
77
77
  PropertyInfo.prototype.setPropertyType = function (propertyType) {
78
78
  if (typeof propertyType === "function") {
79
- if (!propertyType.prototype || !propertyType.prototype.constructor.name) {
79
+ if (!propertyType.prototype || propertyType.prototype.constructor.name === undefined) {
80
80
  this.typeCallback = propertyType;
81
81
  }
82
82
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",