Fix history timeline legend selection. (#276)
parent
82a6b06cfb
commit
c0f119c853
|
@ -123,11 +123,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
daysDelta = (endTime - startTime) / (24 * 3600 * 1000);
|
daysDelta = (endTime - startTime) / (24 * 3600 * 1000);
|
||||||
if (daysDelta > 30) {
|
// Avoid rounding up when the API returns a few extra seconds.
|
||||||
|
if (daysDelta > 30.1) {
|
||||||
options.hAxis.format = 'MMM d';
|
options.hAxis.format = 'MMM d';
|
||||||
} else if (daysDelta > 3) {
|
} else if (daysDelta > 3.1) {
|
||||||
options.hAxis.format = 'EEE, MMM d';
|
options.hAxis.format = 'EEE, MMM d';
|
||||||
} else if (daysDelta > 1) {
|
} else if (daysDelta > 1.1) {
|
||||||
options.hAxis.format = 'EEE, MMM d, H:mm';
|
options.hAxis.format = 'EEE, MMM d, H:mm';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,11 +90,12 @@ Polymer({
|
||||||
}
|
}
|
||||||
format = 'H:mm';
|
format = 'H:mm';
|
||||||
daysDelta = (endTime - startTime) / (24 * 3600 * 1000);
|
daysDelta = (endTime - startTime) / (24 * 3600 * 1000);
|
||||||
if (daysDelta > 30) {
|
// Avoid rounding up when the API returns a few extra seconds.
|
||||||
|
if (daysDelta > 30.1) {
|
||||||
format = 'MMM d';
|
format = 'MMM d';
|
||||||
} else if (daysDelta > 3) {
|
} else if (daysDelta > 3.1) {
|
||||||
format = 'EEE, MMM d';
|
format = 'EEE, MMM d';
|
||||||
} else if (daysDelta > 1) {
|
} else if (daysDelta > 1.1) {
|
||||||
format = 'EEE, MMM d, H:mm';
|
format = 'EEE, MMM d, H:mm';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue