chronic icon indicating copy to clipboard operation
chronic copied to clipboard

Feature to have "previous weekday" as an option.

Open TheMeq opened this issue 8 years ago • 1 comments
trafficstars

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.

TheMeq avatar Oct 25 '17 09:10 TheMeq

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

davispuh avatar Oct 25 '17 16:10 davispuh