Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /app/models/concerns/time_trackable.rb
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/models/concerns/time_trackable.rb')
-rw-r--r--app/models/concerns/time_trackable.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/models/concerns/time_trackable.rb b/app/models/concerns/time_trackable.rb
index a1e7d06b1c1..89b42eec727 100644
--- a/app/models/concerns/time_trackable.rb
+++ b/app/models/concerns/time_trackable.rb
@@ -33,11 +33,11 @@ module TimeTrackable
return if @time_spent == 0
- if @time_spent == :reset
- reset_spent_time
- else
- add_or_subtract_spent_time
- end
+ @timelog = if @time_spent == :reset
+ reset_spent_time
+ else
+ add_or_subtract_spent_time
+ end
end
alias_method :spend_time=, :spend_time
# rubocop:enable Gitlab/ModuleWithInstanceVariables
@@ -50,6 +50,14 @@ module TimeTrackable
Gitlab::TimeTrackingFormatter.output(total_time_spent)
end
+ def time_change
+ @timelog&.time_spent.to_i # rubocop:disable Gitlab/ModuleWithInstanceVariables
+ end
+
+ def human_time_change
+ Gitlab::TimeTrackingFormatter.output(time_change)
+ end
+
def human_time_estimate
Gitlab::TimeTrackingFormatter.output(time_estimate)
end