Skip to content

Commit

Permalink
fix(ui5-date-picker): calibrate the width and alignment of day names (#…
Browse files Browse the repository at this point in the history
…3095)

As the weekday names and the weeks themselves are build in different blocks and arrays, when removing the week numbers( not presenting them) we don't remove the 'filler' block which we insert in the header row where the names are. Now we remove the first block, if the property for hiding weeks is set to true, and then we place the DayPicker content block in the center.

Fixes: #3059
  • Loading branch information
tsanislavgatev authored Apr 5, 2021
1 parent 3508ba8 commit b6c1a0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/main/src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ class DayPicker extends CalendarPart {
}

this._dayNames[1].classes += " ui5-dp-firstday";

if (this.shouldHideWeekNumbers) {
this._dayNames.shift();
}
}

onAfterRendering() {
Expand Down Expand Up @@ -700,6 +704,7 @@ class DayPicker extends CalendarPart {
return {
wrapper: {
display: this._hidden ? "none" : "flex",
"justify-content": "center",
},
main: {
width: "100%",
Expand Down

0 comments on commit b6c1a0a

Please sign in to comment.