diff options
author | Dakkaron <dak1st@gmx.at> | 2018-03-05 19:07:52 +0300 |
---|---|---|
committer | Dakkaron <dak1st@gmx.at> | 2018-03-06 19:01:26 +0300 |
commit | 44177cea3811b450ae65a9dbeb51dac9d0ef5253 (patch) | |
tree | 59daa3dac836c86a639837a6000b3f46412107b4 /lib/gitlab/ci/charts.rb | |
parent | fc9955ce8da200e58fe8fcfef68f02344bfd8390 (diff) |
CI charts now include the current day
Diffstat (limited to 'lib/gitlab/ci/charts.rb')
-rw-r--r-- | lib/gitlab/ci/charts.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/gitlab/ci/charts.rb b/lib/gitlab/ci/charts.rb index 525563a97f5..46ed330dbbf 100644 --- a/lib/gitlab/ci/charts.rb +++ b/lib/gitlab/ci/charts.rb @@ -68,10 +68,11 @@ module Gitlab class YearChart < Chart include MonthlyInterval + attr_reader :to, :from def initialize(*) - @to = Date.today.end_of_month - @from = @to.years_ago(1).beginning_of_month + @to = Date.today.end_of_month.end_of_day + @from = @to.years_ago(1).beginning_of_month.beginning_of_day @format = '%d %B %Y' super @@ -80,10 +81,11 @@ module Gitlab class MonthChart < Chart include DailyInterval + attr_reader :to, :from def initialize(*) - @to = Date.today - @from = @to - 30.days + @to = Date.today.end_of_day + @from = 1.month.ago.beginning_of_day @format = '%d %B' super @@ -92,10 +94,11 @@ module Gitlab class WeekChart < Chart include DailyInterval + attr_reader :to, :from def initialize(*) - @to = Date.today - @from = @to - 7.days + @to = Date.today.end_of_day + @from = 1.week.ago.beginning_of_day @format = '%d %B' super |