diff --git a/src/Squidex/app/shared/state/contents.forms.spec.ts b/src/Squidex/app/shared/state/contents.forms.spec.ts index 882caa758..31e246045 100644 --- a/src/Squidex/app/shared/state/contents.forms.spec.ts +++ b/src/Squidex/app/shared/state/contents.forms.spec.ts @@ -272,7 +272,7 @@ describe('DateTimeField', () => { it('should return calculated date when Today for DateFieldProperties', () => { const field2 = createField({ properties: new DateTimeFieldPropertiesDto('DateTime', { calculatedDefaultValue: 'Today' }) }); - expect(FieldDefaultValue.get(field2, now)).toEqual('2017-10-12'); + expect(FieldDefaultValue.get(field2, now)).toEqual('2017-10-12T00:00:00Z'); }); it('should return calculated date when Now for DateFieldProperties', () => { diff --git a/src/Squidex/app/shared/state/contents.forms.ts b/src/Squidex/app/shared/state/contents.forms.ts index 3a2154cdd..af834ae83 100644 --- a/src/Squidex/app/shared/state/contents.forms.ts +++ b/src/Squidex/app/shared/state/contents.forms.ts @@ -346,9 +346,9 @@ export class FieldDefaultValue implements FieldPropertiesVisitor { const now = this.now || DateTime.now(); if (properties.calculatedDefaultValue === 'Now') { - return now.toUTCStringFormat('YYYY-MM-DDTHH:mm:ss') + 'Z'; + return `${now.toUTCStringFormat('YYYY-MM-DDTHH:mm:ss')}Z`; } else if (properties.calculatedDefaultValue === 'Today') { - return now.toUTCStringFormat('YYYY-MM-DD'); + return `${now.toUTCStringFormat('YYYY-MM-DD')}T00:00:00Z`; } else { return properties.defaultValue; }