mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-20 12:58:46 +01:00
Fix set_min/set_max with a full string timestamp caused a formatting error
This commit is contained in:
parent
2fb1c0e31d
commit
c6ab38a51d
@ -362,6 +362,17 @@ String: A string in the user\'s date format, or a relative date. Relative dates
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Check for full timestamp
|
||||||
|
if(typeof _value == 'string' && _value.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})(?:\.\d{3})?(?:Z|[+-](\d{2})\:(\d{2}))/))
|
||||||
|
{
|
||||||
|
_value = new Date(_value);
|
||||||
|
// Add timezone offset back in, or formatDate will lose those hours
|
||||||
|
var formatDate = new Date(_value + this.date.getTimezoneOffset() * 60 * 1000);
|
||||||
|
if(this._type == 'date')
|
||||||
|
{
|
||||||
|
_value = jQuery.datepicker.formatDate(this.dateFormat, formatDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.input_date.datepicker('option','minDate',_value);
|
this.input_date.datepicker('option','minDate',_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,6 +416,17 @@ String: A string in the user\'s date format, or a relative date. Relative dates
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Check for full timestamp
|
||||||
|
if(typeof _value == 'string' && _value.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})(?:\.\d{3})?(?:Z|[+-](\d{2})\:(\d{2}))/))
|
||||||
|
{
|
||||||
|
_value = new Date(_value);
|
||||||
|
// Add timezone offset back in, or formatDate will lose those hours
|
||||||
|
var formatDate = new Date(_value + this.date.getTimezoneOffset() * 60 * 1000);
|
||||||
|
if(this._type == 'date')
|
||||||
|
{
|
||||||
|
_value = jQuery.datepicker.formatDate(this.dateFormat, formatDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.input_date.datepicker('option','maxDate',_value);
|
this.input_date.datepicker('option','maxDate',_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user