My MWE is based on the excellent template. The original template defines a \vacations command to store the dates of the vacation and the text to be printed; it defines some styles for each of these; and then loops over the calendar dates to apply these styles and print the text. I have tried to adapt the template, but the styles leak across nodes.
Maybe something wrong with my use of .append style?
MWE Expected output: Holidays have gray background and orange text color, other days have white background and black text color.
\documentclass[margin=1pt]{standalone}
\usepackage{tikz}
\usepackage{xparse}
\usetikzlibrary{calc,calendar}
% set current year
\def\currentyear{\the\year}
% set vacation dates
\newcommand*\vacationdata{%
\currentyear-09-02/\currentyear-09-02/Holiday%
}
% set all styles
\tikzset{%
every day/.style={
minimum height=0.8cm,
text width=5cm,
draw=gray
},
every day name/.style={
font=\footnotesize
},
every vacation/.style={
every day/.append style={
fill=gray!30,
text=orange,
}
},
vacation name/.initial=,
}% end of tikzset
\begin{document}
\centering
\begin{tikzpicture}
\calendar[
dates=\currentyear-09-01 to \currentyear-09-03,
name=cal,
day code={%
% print the calendar day number
\node [name=\pgfcalendarsuggestedname, every day/.try] {\tikzdaytext};
% print the calendar day name
\node [anchor=west]
at ([xshift=0.5cm]\pgfcalendarsuggestedname.west)
{\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
% print the vacation name
\pgfkeysifdefined{/tikz/vacation name}{%
\node [every vacation/.try,text width=3cm,xshift=1cm] {\pgfkeysvalueof{/tikz/vacation name}};
}{}%
},
execute before day scope={
% set vacation name
\tikzset{every vacation/.try, vacation name=,
loop over item/.code args={##1/##2/##3}{%
\ifdate{between=##1 and ##2}{%
\tikzset{every vacation/.try, vacation name/.expanded=##3}%
}{}},
loop over item/.list/.expanded=\vacationdata}%
},
execute at begin day scope={%
\pgftransformyshift{-1*\pgfcalendarcurrentday cm}
}
];
\end{tikzpicture}
\end{document}


yinHolidayhas a descender. You can play with tikz optionstext heightandtext depth, see pgfmanual sec. 5.1 "Styling the Nodes". – muzimuzhi Z Sep 09 '21 at 00:14midanchors (egmid west) – Andrew Stacey Sep 09 '21 at 05:50