Skip to content

Commit a2b0d90

Browse files
Update src/js/timeseries.js
Co-authored-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
1 parent c294a89 commit a2b0d90

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/js/timeseries.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ function drawChart(options, series) {
318318

319319
const changelog = flags[this.x];
320320

321-
// Drop the 1st day from dates as data is for month, rather than
322-
// specific date. However, include the non-01 dates from when we
323-
// used to run an early (01) and late (15 typically) crawl.
324-
const formattedDate = Highcharts.dateFormat('%e', this.x) === ' 1' ?
325-
Highcharts.dateFormat('%b %Y', this.x) :
321+
// Use short format (month + year) for dates from 2019 onwards when
322+
// we switched to monthly crawls. Show full date for older data that
323+
// may have had mid-month crawls.
324+
const formattedDate = this.x >= Date.UTC(2019, 0, 1) ?
325+
Highcharts.dateFormat('%b %Y', this.x) :
326326
Highcharts.dateFormat('%b %e, %Y', this.x);
327327
const tooltip = `<p style="font-size: smaller; text-align: center;">${formattedDate}</p>`;
328328

0 commit comments

Comments
 (0)