mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
Fix date display
This commit is contained in:
parent
4f45bb0480
commit
fb60032a75
@ -184,8 +184,6 @@ class DatePicker extends React.Component {
|
||||
const redirects = [{date: false, period: 'day'}, {date: shiftDays(nowForSite(this.props.site), -1), period: 'day'}, {period: 'realtime'}, {date: false, period: '7d'}, {date: false, period: 'month'}, {date: false, period: 'year'}, {date: false, period: '30d'}, {date: false, period: '6mo'}, {date: false, period: '12mo'}, {date: false, period: 'all'}];
|
||||
|
||||
if (keys.includes(e.key.toLowerCase())) {
|
||||
console.log(e.key.toLowerCase())
|
||||
console.log(redirects[keys.indexOf(e.key.toLowerCase())])
|
||||
navigateToQuery(history, query, {...newSearch, ...(redirects[keys.indexOf(e.key.toLowerCase())])});
|
||||
} else if (e.key.toLowerCase() === 'c') {
|
||||
this.setState({mode: 'calendar', open: true}, this.openCalendar);
|
||||
|
@ -51,11 +51,11 @@ function buildDataSet(plot, present_index, ctx, label) {
|
||||
}
|
||||
}
|
||||
|
||||
import {formatMonthYYYY, formatDay} from '../util/date'
|
||||
import {parseUTCDate, formatMonthYYYY, formatDay} from '../util/date'
|
||||
|
||||
function dateFormatter(interval, longForm) {
|
||||
return function(isoDate, _index, _ticks) {
|
||||
let date = new Date(isoDate)
|
||||
let date = parseUTCDate(isoDate)
|
||||
|
||||
if (interval === 'month') {
|
||||
return formatMonthYYYY(date)
|
||||
|
Loading…
Reference in New Issue
Block a user