mirror of
https://github.com/ozntel/oz-calendar.git
synced 2026-07-22 07:40:24 +00:00
#9 Highlight Current Day ignoring Selected Day
This commit is contained in:
parent
4f30fe49bb
commit
3cc48dbdf4
2 changed files with 24 additions and 0 deletions
|
|
@ -87,6 +87,16 @@ export default function MyCalendar(params: { plugin: OZCalendarPlugin }) {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const customTileClass = ({ activeStartDate, date, view }: CalendarTileProperties) => {
|
||||||
|
// Assign a custom class in case the day is the current day
|
||||||
|
let today = new Date();
|
||||||
|
return date.getFullYear() === today.getFullYear() &&
|
||||||
|
date.getMonth() === today.getMonth() &&
|
||||||
|
date.getDate() === today.getDate()
|
||||||
|
? 'oz-calendar-plugin-today'
|
||||||
|
: '';
|
||||||
|
};
|
||||||
|
|
||||||
const fixedCalendarClass = plugin.settings.fixedCalendar ? 'fixed' : '';
|
const fixedCalendarClass = plugin.settings.fixedCalendar ? 'fixed' : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -98,6 +108,7 @@ export default function MyCalendar(params: { plugin: OZCalendarPlugin }) {
|
||||||
minDetail="month"
|
minDetail="month"
|
||||||
view="month"
|
view="month"
|
||||||
tileContent={customTileContent}
|
tileContent={customTileContent}
|
||||||
|
tileClassName={customTileClass}
|
||||||
calendarType={plugin.settings.calendarType}
|
calendarType={plugin.settings.calendarType}
|
||||||
showFixedNumberOfWeeks={plugin.settings.fixedCalendar}
|
showFixedNumberOfWeeks={plugin.settings.fixedCalendar}
|
||||||
activeStartDate={activeStartDate}
|
activeStartDate={activeStartDate}
|
||||||
|
|
|
||||||
13
styles.css
13
styles.css
|
|
@ -18,6 +18,13 @@ settings:
|
||||||
type: variable-color
|
type: variable-color
|
||||||
format: hex
|
format: hex
|
||||||
default: '#'
|
default: '#'
|
||||||
|
-
|
||||||
|
id: oz-calendar-current-day-color
|
||||||
|
title: Current Day (Today) Text Color
|
||||||
|
description: Set the color of the current day in the month view
|
||||||
|
type: variable-color
|
||||||
|
format: hex
|
||||||
|
default: '#'
|
||||||
-
|
-
|
||||||
id: oz-calendar-selected-day-background
|
id: oz-calendar-selected-day-background
|
||||||
title: Selected Day Background Color
|
title: Selected Day Background Color
|
||||||
|
|
@ -40,6 +47,7 @@ settings:
|
||||||
--oz-calendar-selected-daycolor: var(--text-normal);
|
--oz-calendar-selected-daycolor: var(--text-normal);
|
||||||
--oz-calendar-selected-day-background: var(--interactive-accent);
|
--oz-calendar-selected-day-background: var(--interactive-accent);
|
||||||
--oz-calendar-header-date-color: var(--interactive-accent);
|
--oz-calendar-header-date-color: var(--interactive-accent);
|
||||||
|
--oz-calendar-current-day-color: #74dd58;
|
||||||
}
|
}
|
||||||
|
|
||||||
.oz-cal-coffee-div,
|
.oz-cal-coffee-div,
|
||||||
|
|
@ -229,6 +237,11 @@ settings:
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oz-calendar-plugin-today abbr {
|
||||||
|
color: var(--oz-calendar-current-day-color);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
/* START - Fixed Calendar Except Note List - Scroll */
|
/* START - Fixed Calendar Except Note List - Scroll */
|
||||||
|
|
||||||
.oz-calendar-plugin-view.fixed {
|
.oz-calendar-plugin-view.fixed {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue