chronic
chronic copied to clipboard
Feature to have "previous weekday" as an option.
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.
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