From 8bceecb344e055425dcbb25aae27d3736cd4de65 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Mon, 10 Jan 2011 19:16:30 +0100 Subject: improve the date format in 'Time changes' select-box --- .../src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 6 +++--- .../src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'sonar-server') diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index a3a982e0163..feff2e8e1ea 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -86,11 +86,11 @@ module ApplicationHelper if mode=='days' label = "over %s days" % mode_param elsif mode=='version' - label = "since version %s (%s)" % [mode_param, l(date)] + label = "since version %s (%s)" % [mode_param, (date.strftime("%Y %b %d"))] elsif mode=='previous_analysis' - label = "since previous analysis (%s)" % l(date) + label = "since previous analysis (%s)" % (date.strftime("%Y %b %d")) elsif mode=='date' - label = "since #{localize(date)}" + label = "since #{date.strftime("%Y %b %d")}" end end label diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb index fcab616168a..6fb2a240cb7 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb @@ -23,6 +23,7 @@ module DrilldownHelper return nil if snapshot.nil? || snapshot.project_snapshot.nil? mode=snapshot.project_snapshot.send "period#{index}_mode" mode_param=snapshot.project_snapshot.send "period#{index}_param" + date=snapshot.project_snapshot.send "period#{index}_date" if mode if mode=='days' @@ -30,9 +31,9 @@ module DrilldownHelper elsif mode=='version' label = "Added since version %s" % mode_param elsif mode=='previous_analysis' - label = "Added since previous analysis (%s)" % localize(Date.parse(mode_param)) + label = "Added since previous analysis (%s)" % date.strftime("%Y %b. %d") elsif mode=='date' - label = "Added since #{localize(Date.parse(mode_param))}" + label = "Added since #{date.strftime("%Y %b %d")}" end if label selected=(params[:period]==index.to_s ? 'selected' : '') -- cgit v1.2.3