From ef604942844f4383d2e2bb71b08b7eb213df5c33 Mon Sep 17 00:00:00 2001 From: malik najjar Date: Fri, 27 Sep 2024 10:22:39 +0200 Subject: [PATCH] toml strigifies dates fields value as string instead of date fix --- src/guifier/fields/baseFields/DateField/DateField.ts | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guifier/fields/baseFields/DateField/DateField.ts b/src/guifier/fields/baseFields/DateField/DateField.ts index 365bc95..b4e6c0b 100644 --- a/src/guifier/fields/baseFields/DateField/DateField.ts +++ b/src/guifier/fields/baseFields/DateField/DateField.ts @@ -70,6 +70,6 @@ export class DateField extends Field { */ private inputEventHandler (event: Event): void { const element = event.target as HTMLInputElement - this.setValue(element.value) + this.setValue(new Date(element.value)) } } diff --git a/src/main.ts b/src/main.ts index 45587dc..4886d8c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,7 +14,7 @@ async function init (): Promise { fullScreen: true, onChange: () => { console.log('guifier has changed') - console.log(guifier.getData(DataType.Json)) + console.log(guifier.getData(DataType.Toml)) } }