Skip to content

Commit

Permalink
validate if date is valid before updating the value to prevent invali…
Browse files Browse the repository at this point in the history
…d dates sent to the server, fixes ST-255
  • Loading branch information
Onatcer committed Jun 18, 2024
1 parent c0212ec commit c4757ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/js/Components/Common/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function updateDate(event: Event) {
const target = event.target as HTMLInputElement;
const newValue = target.value;
const newDate = getDayJsInstance()(newValue);
if (newDate) {
if (newDate.isValid()) {
model.value = getLocalizedDayJs(model.value)
.set('year', newDate.year())
.set('month', newDate.month())
Expand Down

0 comments on commit c4757ee

Please sign in to comment.