Skip to content

Commit

Permalink
Merge pull request #1917 from nextcloud/fix/1014/datepicker-weeknumber
Browse files Browse the repository at this point in the history
Fix datepicker overflow when week numbers are shown
  • Loading branch information
skjnldsv authored May 4, 2021
2 parents d67507b + d62a940 commit b8e063c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/DatetimePicker/DatetimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export default {
:type="type"
:value="value"
:append-to-body="appendToBody"
:show-week-number="showWeekNumber"
:popup-class="{ 'show-week-number': showWeekNumber }"
v-bind="$attrs"
v-on="$listeners"
@select-year="handleSelectYear"
Expand Down Expand Up @@ -158,6 +160,11 @@ export default {
type: Boolean,
default: false,
},

showWeekNumber: {
type: Boolean,
default: false,
},
},

methods: {
Expand Down
4 changes: 4 additions & 0 deletions src/components/DatetimePicker/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ $cell_height: 32px;
border-left: 1px solid var(--color-border);
}
}

&.show-week-number .mx-calendar {
width: $cell_height * 8 + 2 * 5px; // week number + 7 days + padding
}

.mx-datepicker-header {
border-bottom: 1px solid var(--color-border);
Expand Down

0 comments on commit b8e063c

Please sign in to comment.