diff options
| author | Zack Hobson | 2013-11-19 11:21:35 -0800 |
|---|---|---|
| committer | Zack Hobson | 2013-11-19 11:21:35 -0800 |
| commit | 19fbf0cd25b7db54cbafc18658364a69fa0983a8 (patch) | |
| tree | 52103360cf92ece76cd7451da8ed8e19c7030ec2 /lib | |
| parent | e6cef214e2b828279a54dc577eed7b16e12d903e (diff) | |
| download | hcl-19fbf0cd25b7db54cbafc18658364a69fa0983a8.tar.bz2 | |
stop: Check for running timers from yesterday.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/commands.rb | 2 | ||||
| -rw-r--r-- | lib/hcl/day_entry.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index 38f7ab1..00ab7b1 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -63,7 +63,7 @@ module HCl end def stop *args - entry = DayEntry.with_timer + entry = DayEntry.with_timer || DayEntry.with_timer(DateTime.yesterday) if entry entry.append_note(args.join(' ')) if args.any? entry.toggle diff --git a/lib/hcl/day_entry.rb b/lib/hcl/day_entry.rb index 84b5e3d..6237fea 100644 --- a/lib/hcl/day_entry.rb +++ b/lib/hcl/day_entry.rb @@ -36,8 +36,8 @@ module HCl %{<request><notes>#{notes}</notes><hours>#{hours}</hours></request>} end - def self.with_timer - all.detect {|t| t.running? } + def self.with_timer date=nil + all(date).detect {|t| t.running? } end def self.last_by_task project_id, task_id |
