6
0
Fork 0

highlight today'S calendar item!

master
Dirk Heilig 2024-02-19 21:14:18 +01:00
parent b75069b033
commit 9c5f358483
2 changed files with 14 additions and 1 deletions

View File

@ -228,6 +228,10 @@ a.external:after {
cursor: pointer;
}
#calendar .today{
color: var(--color-dark-fg-font-hyper-hover);
}
/********** set up break point **********/
.main-wrapper,

View File

@ -24,7 +24,16 @@ const calRefresh=function () {
let li = $("<li/>");
//li.text(item.summary)
let startDate = new Date(item.start * 1000);
let date = $("<span class='date row'/>");
//check if the date is within today, not tomorrow, not yesterday
let today = new Date();
let todayString = today.getFullYear() + "-" + zeropad(today.getMonth() + 1) + "-" + zeropad(today.getDate());
let startDateString = startDate.getFullYear() + "-" + zeropad(startDate.getMonth() + 1) + "-" + zeropad(startDate.getDate());
let todayClass=""
if (todayString === startDateString) todayClass=" today";
let date = $("<span class='date row"+todayClass+"'/>");
date.text(
zeropad(startDate.getDate()) +
"." +