Skip to content

Commit

Permalink
#490 done (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaadin-miki authored Nov 10, 2023
1 parent 3dc0776 commit 72e25be
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ export class DatePatternMixin {
}
});
}
// fixes #490 (only when some value is already there)
if (datepicker.value !== undefined && datepicker.value.length > 0) {
let parsed = datepicker.value.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/);
datepicker.inputElement.value = datepicker.i18n.formatDate({day: parseInt(parsed[3], 10), month: parseInt(parsed[2], 10)-1, year: parseInt(parsed[1], 10)});
}
}
}
}
Expand Down

0 comments on commit 72e25be

Please sign in to comment.