Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/templates/xDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const dayTemplate: Template = (
verticalOrientation: OptionsType['verticalOrientation'];
},
) => {
const COLUMNS_COUNT = 7;
const COLUMNS_COUNT = domain.horizontalMonth ? 38 : 7;
const ALLOWED_DOMAIN_TYPE: DomainType[] = ['year', 'month', 'week'];

return {
Expand All @@ -28,7 +28,7 @@ const dayTemplate: Template = (
6, // In rare case, when the first week contains less than 3 days
);
case 'year':
return Math.ceil(
return domain.horizontalMonth ? 12 : Math.ceil(
domain.dynamicDimension ?
DateHelper.date(ts).endOf('year').dayOfYear() / COLUMNS_COUNT :
54,
Expand Down Expand Up @@ -64,7 +64,7 @@ const dayTemplate: Template = (
x = date.subtract(1, 'week').week() + 1;
}

x = date.week() - 1;
x = domain.horizontalMonth ? date.month() : date.week() - 1;
break;
case 'week':
x = date.weekday();
Expand All @@ -75,7 +75,7 @@ const dayTemplate: Template = (
return {
t: ts,
y: x,
x: domain.type === 'week' ? 0 : date.weekday(),
x: domain.type === 'week' ? 0 : domain.horizontalMonth ? date.date() + date.subtract(date.date() - 1, 'day').weekday() - 1 : date.weekday(),
};
}),
extractUnit: (ts) => DateHelper.date(ts).startOf('day').valueOf(),
Expand Down