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

Feature to have "previous weekday" as an option. #368

Open
TheMeq opened this issue Oct 25, 2017 · 1 comment
Open

Feature to have "previous weekday" as an option. #368

TheMeq opened this issue Oct 25, 2017 · 1 comment

Comments

@TheMeq
Copy link

TheMeq commented Oct 25, 2017

We run reports during the week that use chronic via Spiceworks. We have to manually change the date to the previous weekday as we don't need to run reports for the weekend. Would it be possible to add a weekday option that only include Monday through Friday? Thanks.

@davispuh
Copy link
Collaborator

davispuh commented Oct 25, 2017

But there already is such option...

 Chronic.parse('last weekday', :guess => false, :context => :past, :now => Time.parse('2017-10-24'))
=> 2017-10-23 00:00:00 +0300..2017-10-24 00:00:00 +0300

Chronic.parse('last weekday', :guess => false, :context => :past, :now => Time.parse('2017-10-23'))
=> 2017-10-20 00:00:00 +0300..2017-10-21 00:00:00 +0300

Chronic.parse('last weekday', :guess => false, :context => :past, :now => Time.parse('2017-10-22'))
=> 2017-10-20 00:00:00 +0300..2017-10-21 00:00:00 +0300

Chronic.parse('last weekday', :guess => false, :context => :past, :now => Time.parse('2017-10-21'))
=> 2017-10-20 00:00:00 +0300..2017-10-21 00:00:00 +0300

Chronic.parse('last weekday', :guess => false, :context => :past, :now => Time.parse('2017-10-20'))
=> 2017-10-19 00:00:00 +0300..2017-10-20 00:00:00 +0300

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