Skip to content

Commit 70449b9

Browse files
Felipe Langjavier-godoy
authored andcommitted
fix: ignore browser timezone when parsing selected value
Close #59
1 parent 13a06cc commit 70449b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/resources/META-INF/frontend/fc-inline-date-picker/fc-inline-date-picker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export class InlineDatePicker extends LitElement {
4040

4141
willUpdate(changedProperties) {
4242
if (changedProperties.has('value')) {
43-
this.date = this.value ? new Date(this.value) : undefined;;
43+
this.date = this.value ? new Date(this.value) : undefined;
44+
if(this.date){
45+
// normalize date ignoring browser timezone
46+
this.date = new Date(this.date.toISOString().slice(0, -1));
47+
}
4448
}
4549
if (changedProperties.has('date')) {
4650
this.value = this.date ? this.date.toISOString().substring(0,10) : undefined;

0 commit comments

Comments
 (0)