prepare side pane, highlight today

This commit is contained in:
marlon-erler
2024-07-26 05:32:07 +02:00
parent a14a275f1f
commit 934a91285e
7 changed files with 50 additions and 9 deletions
+7 -1
View File
@@ -52,8 +52,12 @@ export default class CalendarModel {
month: number,
defaultValueCreator: () => T
): MonthGrid<T> => {
// get first day of month
// get today
const date: Date = new Date();
const isCurrentMonth: boolean =
year == date.getFullYear() && month == date.getMonth() + 1;
// get first day of month
date.setFullYear(year);
date.setMonth(month - 1);
date.setDate(1);
@@ -70,6 +74,7 @@ export default class CalendarModel {
const grid: MonthGrid<T> = {
offset,
firstDayOfWeek: parseInt(this.settingsModel.firstDayOfWeek),
isCurrentMonth,
days: {},
};
@@ -117,5 +122,6 @@ export enum CalendarModelSubPaths {
export interface MonthGrid<T> {
offset: number;
firstDayOfWeek: number;
isCurrentMonth: boolean;
days: { [date: string]: T };
}