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

Support for varying working weeks based on region? #62

Open
broomfn opened this issue Jan 7, 2022 · 4 comments
Open

Support for varying working weeks based on region? #62

broomfn opened this issue Jan 7, 2022 · 4 comments

Comments

@broomfn
Copy link

broomfn commented Jan 7, 2022

Hi, it doesn't look like you support different working weeks (based on region) out of the box? This seems pretty fundamental for a business days plugin?

https://en.wikipedia.org/wiki/Workweek_and_weekend

Please correct me if I'm wrong as I'd love to use your plugin?

Thanks

@amaidah
Copy link
Owner

amaidah commented Feb 23, 2022

Could you give me an example?

@broomfn
Copy link
Author

broomfn commented Feb 23, 2022

I'm not entirely sure what you mean, so please correct me if I've misunderstood, but if you take a look at the Wikipedia link I posted, you'll see a number of countries work Monday to Saturday for example:

image

@amaidah
Copy link
Owner

amaidah commented Sep 6, 2022

Could you give me an example of how you want to configure working days that is not currently doable?

If you look at the readme: https://github.com/amaidah/luxon-business-days#configure-business-days, you can configure business days or what you are calling working days.

Monday to Saturday working week (business days) would be:

import { DateTime } from 'luxon-business-days';

const dt = DateTime.local();

const workingWeek = [1, 2, 3, 4, 5, 6]; // Mon - Sat

dt.setupBusiness({ businessDays: workingWeek });

@broomfn
Copy link
Author

broomfn commented Sep 6, 2022

I guess what I'm looking for is something that will manage the database or working days for me, we're writing a global time sheeting application and I don't want to have to manage a database of which countries work which days, so taking your example above, I'd like to be able to do:

dt.setupBusiness({ country: 'India' });

Better still the system would automatically pick this up, based on the locale set and a method call to dt.getBusinessDays() would return me which days in the current country/locale are working days (e.g. Monday to Thursday [1, 2, 3, 4])

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

No branches or pull requests

2 participants