P
Phrogz
current_time = Time.new
due_time = # ... some Time instance in the future
work_hours_left_before_I_am_screwed = # ... calculate
I'm writing a little task-tracking app to help me put out the most
urgent fires. As above, given any two Time instances, I'd like to know
how many hours are left to perform the task. This should skip weekends
and hours outside of specified start- and end-hours for a work day.
Anyone got such code handy? Or feel like writing it for me?
Right now, my best idea involves looping over the range one day at a
time and manually accumulating the available hours. It feels
inelegant, but it's all I have right now.
due_time = # ... some Time instance in the future
work_hours_left_before_I_am_screwed = # ... calculate
I'm writing a little task-tracking app to help me put out the most
urgent fires. As above, given any two Time instances, I'd like to know
how many hours are left to perform the task. This should skip weekends
and hours outside of specified start- and end-hours for a work day.
Anyone got such code handy? Or feel like writing it for me?
Right now, my best idea involves looping over the range one day at a
time and manually accumulating the available hours. It feels
inelegant, but it's all I have right now.