diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 96ecff48817..6cf481b4ce2 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -419,7 +419,7 @@ function determineLabelFormat(timestamps) { if (ts % INTERVALS.second.size !== 0) { return presets.full; } - if (ts % INTERVALS.day.size !== 0) { + if (!hasTime && adapter.startOf(ts, 'day') !== ts) { hasTime = true; } } diff --git a/test/specs/scale.time.tests.js b/test/specs/scale.time.tests.js index 192ec8229c3..c5be682d95d 100755 --- a/test/specs/scale.time.tests.js +++ b/test/specs/scale.time.tests.js @@ -662,8 +662,8 @@ describe('Time scale tests', function() { datasets: [{ xAxisID: 'xScale0', data: [ - {t: +new Date('2018-01-08 00:00:00Z'), y: 10}, - {t: +new Date('2018-01-09 00:00:00Z'), y: 3} + {t: +new Date('2018-01-08 00:00:00'), y: 10}, + {t: +new Date('2018-01-09 00:00:00'), y: 3} ] }], },