Skip to content

Commit b6c1a0a

Browse files
fix(ui5-date-picker): calibrate the width and alignment of day names (#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
1 parent 3508ba8 commit b6c1a0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/main/src/DayPicker.js

+5
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ class DayPicker extends CalendarPart {
307307
}
308308

309309
this._dayNames[1].classes += " ui5-dp-firstday";
310+
311+
if (this.shouldHideWeekNumbers) {
312+
this._dayNames.shift();
313+
}
310314
}
311315

312316
onAfterRendering() {
@@ -700,6 +704,7 @@ class DayPicker extends CalendarPart {
700704
return {
701705
wrapper: {
702706
display: this._hidden ? "none" : "flex",
707+
"justify-content": "center",
703708
},
704709
main: {
705710
width: "100%",

0 commit comments

Comments
 (0)