Skip to main content

๐Ÿ China Holiday

zjkalLess than 1 minute

๐Ÿ China Holiday

Tips

Specifically for China's holidays, it currently includes the holiday data of '2020-2024', and will continue to be updated in the future. In order to facilitate maintenance and use, a new class 'ChinaHoliday' was created

isWorkday()

Determine whether the date is a working day in China

Parameters

ParameterIntroductionRequire
datetimeAny type of string time or timestampOptional, defaults to the current time

Return Values

'true' if it's a working day, 'false' if it's otherwise

Example code

/* Determine whether the following dates are working days in China */
ChinaHoliday::isWorkday('2023-01-29');
// true

/* Determine whether today is a Chinese working day */
ChinaHoliday::isWorkday();
// true

isHoliday()

Determine whether the date is a Chinese holiday

Parameters

ParameterIntroductionRequire
datetimeAny type of string time or timestampOptional, defaults to the current time

Return Values

'true' if it's a holiday, 'false' if it's otherwise

Example code

/* Determine whether the following dates are Chinese holidays */
ChinaHoliday::isHoliday('2023-01-28');
// false