Skip to content

Commit

Permalink
utilize browser timezone for date formatting #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Kübler committed Sep 15, 2014
1 parent 1fa7110 commit 7c1d13a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/assets/javascripts/views/common/MetricChart.coffee
Expand Up @@ -43,17 +43,16 @@ class @MetricChartView extends Backbone.View
@hoverDetail = new Rickshaw.Graph.HoverDetail
graph: @graph
yFormatter: ((y) => y)
xFormatter: ((x) => new Date(x * 1000).toLocaleString())
formatter: ((series, x, y, formattedX, formattedY, d) =>
"#{series.name} : #{series.denormalize(y)} #{series.unit}"
)

time = new Rickshaw.Fixtures.Time()
@xAxis = new RickshawUtil.LeftAlignedXAxis
graph: @graph
element: @$(".x-axis")[0]
tickFormat: (x) ->
d = new Date(x * 1000)
time.formatTime(d)
new Date(x * 1000).toLocaleTimeString(navigator.language, {hour: '2-digit', minute:'2-digit'})

@slider = new Rickshaw.Graph.RangeSlider
graph: @graph,
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/views/regions/ShowRegion.coffee
Expand Up @@ -11,6 +11,7 @@ class @ShowRegionView extends Backbone.View
el: @$(".refresh-text")
pattern: "(next refresh in %delay% seconds)"
@visualCountDown.on "done", _.bind(@updateMetrics, @)

@updateMetrics()

createRegionMetricChartView: ($el) ->
Expand Down

0 comments on commit 7c1d13a

Please sign in to comment.