Commit 88a630c1 authored by Ruben Davila's avatar Ruben Davila

Add ability to reduce time from timesheet.

parent 397b63aa
...@@ -269,7 +269,11 @@ module SlashCommands ...@@ -269,7 +269,11 @@ module SlashCommands
end end
command :spend do |raw_duration| command :spend do |raw_duration|
begin begin
@updates[:time_spent] = ChronicDuration.parse(raw_duration, default_unit: 'hours') reduce_time = raw_duration.gsub!(/\A-/, '')
time_spent = ChronicDuration.parse(raw_duration, default_unit: 'hours')
time_spent = time_spent * -1 if reduce_time
@updates[:time_spent] = time_spent
rescue ChronicDuration::DurationParseError rescue ChronicDuration::DurationParseError
# do nothing # do nothing
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment