mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-15 02:19:36 +01:00
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:
parent
c4a8996209
commit
dacb898218
@ -375,9 +375,15 @@ 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)
|
||||||
{
|
{
|
||||||
this.input_date.attr('min', this._relativeDate(_value));
|
this.input_date.attr('min', this._relativeDate(_value));
|
||||||
}
|
}
|
||||||
@ -430,9 +436,15 @@ 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)
|
||||||
{
|
{
|
||||||
this.input_date.attr('max', this._relativeDate(_value));
|
this.input_date.attr('max', this._relativeDate(_value));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user