I use library Time4j for Java and I selected some days as holydays and saved in a variables. Now I want to display all days of a year something like on the picture but with my holydays highlighted.
How can I make it?
I use library Time4j for Java and I selected some days as holydays and saved in a variables. Now I want to display all days of a year something like on the picture but with my holydays highlighted.
How can I make it?
Copyright © 2021 Jogjafile Inc.
I present a Time4J-example for one month only which can easily be applied on every month of a full calendar year. Holidays are not explicitly supported by Time4J, but I have presented a simple HTML-example how to highlight special days, here weekends.
About holidays: If you have defined a list of holidays per year then you can ask a date to be a holiday or not by using an expression like
boolean isHoliday = holidayList.contains(date)
. By the way, the newest version of Time4J (v3.16/v4.13) also supports computation of Easter, so the computation of any holidays per year should not be so difficult in Western locales.Updated to realize a localized start of week which requires the usage of two week models:
Example output: