It ’s a process of creating a calendar and taking a day between holidays as a holiday,
・ Basic calendar creation is complete.
・ When the holiday is a Sunday, the process of making a Monday a holiday is completed.
You can set a flag on Sundays and public holidays and make it a holiday if the flag is set on Monday.

This time
・ To make a day between holidays a holiday
I thought that it was a national holiday in order from the start date, but
-In the case of 5/4, you must see 5/3 and 5/5. (Look ahead)
• In the case of 4/30, you must see 4/29 and 5/1. (Next month's calendar)
・ If 4/30 and 5/2 are public holidays (not currently), you must also look at the calendar of last month.

I thought I would put a table of holidays from the previous day to the next day, but
If I want to make a 12 month calendar, you will need a huge table,
The process of looking at the previous day and looking at the next day in a day's processing is useless.

What kind of logic should be combined?

  • Answer # 1

    It's better to leave yesterday and tomorrow yesterday with variables for 3 days

Related articles