mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-16 19:08:27 +01:00
Fix Et2DateTimeOnly displayed 00:00 when value was ""
This commit is contained in:
parent
be4633c9fa
commit
b8455e0b8d
@ -44,23 +44,27 @@ export class Et2DateTimeOnly extends Et2DateTime
|
|||||||
|
|
||||||
set_value(value)
|
set_value(value)
|
||||||
{
|
{
|
||||||
|
let adjustedValue : Date | string = '';
|
||||||
if(!value || value == 0 || value == "0")
|
if(!value || value == 0 || value == "0")
|
||||||
{
|
{
|
||||||
value = '';
|
value = '';
|
||||||
}
|
}
|
||||||
// Handle timezone offset, flatpickr uses local time
|
// Handle timezone offset, flatpickr uses local time
|
||||||
let date = new Date(value);
|
if(value)
|
||||||
let formatDate = new Date(date.valueOf() + date.getTimezoneOffset() * 60 * 1000);
|
{
|
||||||
formatDate.setDate(1);
|
let date = new Date(value);
|
||||||
formatDate.setMonth(0)
|
adjustedValue = new Date(date.valueOf() + date.getTimezoneOffset() * 60 * 1000);
|
||||||
formatDate.setFullYear(1970);
|
adjustedValue.setDate(1);
|
||||||
|
adjustedValue.setMonth(0)
|
||||||
|
adjustedValue.setFullYear(1970);
|
||||||
|
}
|
||||||
if(!this._instance)
|
if(!this._instance)
|
||||||
{
|
{
|
||||||
this.defaultDate = formatDate;
|
this.defaultDate = adjustedValue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.setDate(formatDate);
|
this.setDate(adjustedValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user