From eb1ed53c1a47e94f39c30184d9f6027d5996515b Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 19 Oct 2021 14:23:31 -0600 Subject: [PATCH] JS changes from 068e3feff09e54f176d99fc5defbae0c7e439b81 --- api/js/etemplate/et2_widget_date.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/js/etemplate/et2_widget_date.js b/api/js/etemplate/et2_widget_date.js index 09ebf2e4c5..8c1ca092c5 100644 --- a/api/js/etemplate/et2_widget_date.js +++ b/api/js/etemplate/et2_widget_date.js @@ -285,6 +285,11 @@ var et2_date = /** @class */ (function (_super) { * @param {Date|Number|String} _value */ et2_date.prototype.set_min = function (_value) { + // minDate option checks the type, so make sure we're passing numbers as numbers (0, not "0") + // @ts-ignore + if (typeof _value === "string" && !isNaN(_value) && "" + parseInt(_value) == _value) { + _value = parseInt(_value); + } if (this.input_date) { if (this.is_mobile) { this.input_date.attr('min', this._relativeDate(_value)); @@ -331,6 +336,11 @@ var et2_date = /** @class */ (function (_super) { * @param {Date|Number|String} _value */ et2_date.prototype.set_max = function (_value) { + // maxDate option checks the type, so make sure we're passing numbers as numbers (0, not "0") + // @ts-ignore + if (typeof _value === "string" && !isNaN(_value) && "" + parseInt(_value) == _value) { + _value = parseInt(_value); + } if (this.input_date) { if (this.is_mobile) { this.input_date.attr('max', this._relativeDate(_value));