summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-01-28 12:21:27 +0100
committerTeddy Wing2018-01-28 12:21:27 +0100
commit9c0036f3a1cad39c9bb6da062004d1b09ae66e61 (patch)
tree1a2dcaf3053ac16b941ab0c0c7dd1ea5cfe7a03d
parent3b62915501e8dd7b29af5fb9ff23bed59c04d600 (diff)
downloadhcl-9c0036f3a1cad39c9bb6da062004d1b09ae66e61.tar.bz2
Task#add: Don't use `strftime` on `spent_at`
Before I modified it, the code passed `Date.today` plain in `spent_at`. Don't bother `strftime`ing since it can just take a Ruby date object.
-rw-r--r--lib/hcl/task.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hcl/task.rb b/lib/hcl/task.rb
index 58b32d7..313fdf1 100644
--- a/lib/hcl/task.rb
+++ b/lib/hcl/task.rb
@@ -50,7 +50,7 @@ module HCl
def add http, opts
notes = opts[:note]
starting_time = opts[:starting_time] || 0
- spent_at = (opts[:spent_at] || Date.today).strftime('%F')
+ spent_at = opts[:spent_at] || Date.today
DayEntry.new http.post("daily/add", {
notes: notes,
hours: starting_time,