Api: Fix setting the date min attribute to a number did not work

jQueryUI timepicker checks the type of variable
This commit is contained in:
nathan 2021-10-19 14:15:37 -06:00
parent 7a7f80f7d9
commit 068e3feff0

View File

@ -397,6 +397,12 @@ String: A string in the user\'s date format, or a relative date. Relative dates
*/ */
set_min(_value) set_min(_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.input_date)
{ {
if(this.is_mobile) if(this.is_mobile)
@ -452,6 +458,12 @@ String: A string in the user\'s date format, or a relative date. Relative dates
*/ */
set_max(_value) set_max(_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.input_date)
{ {
if(this.is_mobile) if(this.is_mobile)