Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hope to support setting additional working days #6

Closed
superche opened this issue Jan 20, 2023 · 2 comments · Fixed by #7
Closed

feat: hope to support setting additional working days #6

superche opened this issue Jan 20, 2023 · 2 comments · Fixed by #7

Comments

@superche
Copy link
Contributor

Describe the feature you'd like to request

Sometime, there are official additional working days to compensate for the long holiday break. I hope to support setting additional working days, and update isBusinessDay. I think it would be useful.

Use case example.

During Chinese New Year 2023, Chinese official holiday and additional working days are:

  • holiday: from Jan 21 to Jan 27
  • additional working days: Jan 28, Jan 29

ref: https://calendars.icloud.com/holidays/cn_zh.ics

Describe the solution you'd like to see

new API: setAdditionalWorkingDays() => void

Sets the additional working day list to the given array of strings

dayjs.setAdditionalWorkingDays([ `2023-01-28`, `2023-01-29` ]);

update API: isBusinessDay

after setAdditionalWorkingDays

dayjs(`2023-01-28`).isBusinessDay(); // returns true
@reediculous456
Copy link
Owner

Based on my understanding of the ask here, you would set your normal working days (ex. Mon-Fri) and then use the additional days property to tell the package you will be working a one-off Sat-Sun

Can you please confirm if my example lines up with what you're asking for?

@superche
Copy link
Contributor Author

Based on my understanding of the ask here, you would set your normal working days (ex. Mon-Fri) and then use the additional days property to tell the package you will be working a one-off Sat-Sun

Can you please confirm if my example lines up with what you're asking for?

Correct.
In the example "Chinese New Year 2023", additional working days are Jan 28, Jan 29. Those additional working days are one-off.
"Chinese New Year 2024" additional working days may be not Jan 28, Jan 29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants