Skip to content

Commit

Permalink
Merge pull request #6425 from getkirby/fix/6422-calender-empty
Browse files Browse the repository at this point in the history
CalendarInput: fix when no value
  • Loading branch information
bastianallgeier committed May 2, 2024
2 parents b9ad2de + d5ae9c3 commit 2fa6396
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions panel/src/components/Forms/Input/CalendarInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ import { IsoDateProps } from "./DateInput.vue";
export default {
mixins: [InputProps, IsoDateProps],
data() {
const today = this.$library.dayjs();
return {
maxdate: null,
mindate: null,
month: null,
month: today.month(),
selected: null,
today: this.$library.dayjs(),
year: null
today: today,
year: today.year()
};
},
computed: {
Expand Down Expand Up @@ -309,8 +311,10 @@ export default {
* @param {number} day
* @param {number} month
*/
toDate(day = 1, month = this.month) {
return this.$library.dayjs(`${this.year}-${month + 1}-${day}`);
toDate(day = 1, month) {
return this.$library.dayjs(
`${this.year}-${(month ?? this.month) + 1}-${day}`
);
},
/**
* Generates select options between min and max
Expand Down

0 comments on commit 2fa6396

Please sign in to comment.