Skip to content

Commit 489ea17

Browse files
authored
fix(Axis): Fix multiline month when day tick does not align on first of month (#517)
1 parent ce15983 commit 489ea17

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/social-masks-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'layerchart': patch
3+
---
4+
5+
fix(Axis): Fix multiline month when day tick does not align on first of month

packages/layerchart/src/lib/utils/ticks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function getDurationFormat(duration: Duration, multiline = false) {
3131
}
3232
} else if (+duration >= +new Duration({ duration: { days: 1 } })) {
3333
// Day
34-
const isFirst = i === 0 || +timeMonth.floor(date) === +date;
34+
const isFirst = i === 0 || date.getDate() < duration.days;
3535
if (multiline) {
3636
return (
3737
format(date, PeriodType.Custom, { custom: DateToken.DayOfMonth_numeric }) +

0 commit comments

Comments
 (0)