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;
|
||||
};
|
||||
|
||||
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' : '';
|
||||
|
||||
return (
|
||||
|
|
@ -98,6 +108,7 @@ export default function MyCalendar(params: { plugin: OZCalendarPlugin }) {
|
|||
minDetail="month"
|
||||
view="month"
|
||||
tileContent={customTileContent}
|
||||
tileClassName={customTileClass}
|
||||
calendarType={plugin.settings.calendarType}
|
||||
showFixedNumberOfWeeks={plugin.settings.fixedCalendar}
|
||||
activeStartDate={activeStartDate}
|
||||
|
|
|
|||
13
styles.css
13
styles.css
|
|
@ -18,6 +18,13 @@ settings:
|
|||
type: variable-color
|
||||
format: hex
|
||||
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
|
||||
title: Selected Day Background Color
|
||||
|
|
@ -40,6 +47,7 @@ settings:
|
|||
--oz-calendar-selected-daycolor: var(--text-normal);
|
||||
--oz-calendar-selected-day-background: var(--interactive-accent);
|
||||
--oz-calendar-header-date-color: var(--interactive-accent);
|
||||
--oz-calendar-current-day-color: #74dd58;
|
||||
}
|
||||
|
||||
.oz-cal-coffee-div,
|
||||
|
|
@ -229,6 +237,11 @@ settings:
|
|||
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 */
|
||||
|
||||
.oz-calendar-plugin-view.fixed {
|
||||
|
|
|
|||
Loading…
Reference in a new issue