Skip to content

Commit

Permalink
Bug Fixes Date Picker (#241)
Browse files Browse the repository at this point in the history
* add teleport to calendar

* remove error message

* adapt error message behaviour in getDatumOfString

* reformat code
  • Loading branch information
boal authored Dec 5, 2024
1 parent c0c35f0 commit eaf6b0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/src/components/common/DateRangePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
:clearable="false"
:min-date="minDateProp"
:max-date="maxDateProp"
ignore-time-validation
:teleport="true"
:week-numbers="WEEK_NUMBER_OPTIONS"
:six-weeks="SIX_WEEK_CALENDAR_OPTIONS"
cancel-text="Abbrechen"
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/util/DateUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { head, isEqual, last, toArray } from "lodash";
import { head, isEmpty, isEqual, last, toArray } from "lodash";
import moment from "moment";

import i18n from "@/plugins/i18n";
Expand Down Expand Up @@ -111,9 +111,11 @@ export function useDateUtils() {
if (Date.parse(d)) {
return new Date(d);
}
snackbarStore.showError(
`Der angegebene Wert ${datum} kann nicht in ein Datum umgewandelt werden.`
);
if (!isEmpty(datum)) {
snackbarStore.showError(
`Der angegebene Wert ${datum} kann nicht in ein Datum umgewandelt werden.`
);
}
return new Date();
}

Expand Down

0 comments on commit eaf6b0d

Please sign in to comment.