Skip to content

Commit

Permalink
Ordinalize the dates on the project pulse page
Browse files Browse the repository at this point in the history
Also put the dates in an ascending order and added the year
  • Loading branch information
dmarcoux committed Dec 11, 2018
1 parent e6fb2f5 commit 1658139
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/api/app/helpers/webui/project_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ module Webui::ProjectHelper
protected

def pulse_period(range)
start = if range == 'month'
Time.zone.today.prev_month.strftime('%B, %e')
else
Time.zone.today.prev_week.strftime('%B, %e')
end
end_time = Time.zone.today

"#{Time.zone.today.strftime('%B, %e')}#{start}"
start_time = if range == 'month'
end_time.prev_month
else
end_time.prev_week
end

"#{start_time.strftime("%B, #{start_time.day.ordinalize} %Y")}#{end_time.strftime("%B, #{end_time.day.ordinalize} %Y")}"
end

def show_status_comment(comment, package, firstfail, comments_to_clear)
Expand Down

0 comments on commit 1658139

Please sign in to comment.