mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
fix date issue +1 time zone in date widget (#4982)
This commit is contained in:
parent
cb988b0145
commit
4aa0f49c58
@ -398,7 +398,7 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
}
|
||||
break;
|
||||
case FormFieldTypes.DATETIME:
|
||||
const dateTimeValue = moment(this.value, this.dateDisplayFormat, true);
|
||||
const dateTimeValue = moment(this.value, this.dateDisplayFormat, true).utc();
|
||||
if (dateTimeValue && dateTimeValue.isValid()) {
|
||||
/* cspell:disable-next-line */
|
||||
this.form.values[this.id] = dateTimeValue.format('YYYY-MM-DDTHH:mm:ssZ');
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material';
|
||||
@ -75,7 +75,10 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit,
|
||||
this.maxDate = moment(this.field.maxValue, 'YYYY-MM-DDTHH:mm:ssZ');
|
||||
}
|
||||
}
|
||||
this.displayDate = moment(this.field.value, this.field.dateDisplayFormat);
|
||||
this.displayDate = moment(this.field.value, this.field.dateDisplayFormat)
|
||||
.add(
|
||||
moment(this.field.value, this.field.dateDisplayFormat).utcOffset(),
|
||||
'minutes');
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user