Browse Source

improve the date format in 'Time changes' select-box

tags/2.6
simonbrandhof 13 years ago
parent
commit
8bceecb344

+ 3
- 3
sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb View File

@@ -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

+ 3
- 2
sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb View File

@@ -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' : '')

Loading…
Cancel
Save