How does the date plug-in determine whether the selected time is a legal holiday?

now there is a requirement for the front end to check the entered date, one of which is to select traditional holidays & & legal holidays to remind you to choose the wrong date. Is there any good idea or plug-in recommendation if implemented in vue? P.S. Has an idea to write down all the statutory holidays for the next 20 years, but is there a better way to achieve this less elegantly?

Mar.07,2021

the back end maintains a holiday json table.

so if you want to do this, you have to maintain your own json table, which is divided by year.

there is no excellence or elegance in engineering problems


first of all, legal holidays are said to be legal. Before May Day, it was seven days, but now it is not a fart to go to work.
second, suppose that the proposition only needs to be counted up to the holiday day, and then come back to discuss the problem.

  1. some holidays are based on the Gregorian calendar and some on the lunar calendar. The Gregorian calendar is easy to solve, so let's talk about the lunar calendar first.
  2. the lunar calendar is based entirely on astronomical observations without any mathematical relationship.
  3. No data relationship means that it can only be calculated by statistics, and the past date calculated by the model is relatively accurate, but the future date can only be counted as a prediction, so it goes back to the question based on astronomical observation.

so the problem is

  1. you don't know which days to put, you only know 5.1to play, but 4.285.1or 4.295.2you don't know.
  2. you can't count the lunar calendar.
Menu