Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

added minutes to DateAxis in 'hourly' mode #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions custom-weather-card-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,13 @@ class WeatherCardChart extends Polymer.Element {
fontColor: textColor,
maxRotation: 0,
callback: function(value, index, values) {
var data = new Date(value).toLocaleDateString(locale,
{ weekday: 'short' });
var time = new Date(value).toLocaleTimeString(locale,
{ hour: 'numeric' });
if (mode == 'hourly') {
var time = new Date(value).toLocaleTimeString(locale,
{ hour: 'numeric', minute: 'numeric' });
return time;
}
var data = new Date(value).toLocaleDateString(locale,
{ weekday: 'short' });
return data;
},
},
Expand Down