mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 02:24:55 +03:00
Add keyboard shortcut for last 12 months
This commit is contained in:
parent
d40faf6ec7
commit
cd32f0f124
@ -180,8 +180,8 @@ class DatePicker extends React.Component {
|
|||||||
|
|
||||||
this.setState({open: false});
|
this.setState({open: false});
|
||||||
|
|
||||||
const keys = ['d', 'r', 'w', 'm', 'y', 't', 's', 'a'];
|
const keys = ['d', 'e', 'r', 'w', 'm', 'y', 't', 's', 'l', 'a'];
|
||||||
const redirects = [{date: false, 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: 'all'}];
|
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())) {
|
if (keys.includes(e.key.toLowerCase())) {
|
||||||
console.log(e.key.toLowerCase())
|
console.log(e.key.toLowerCase())
|
||||||
@ -297,7 +297,7 @@ class DatePicker extends React.Component {
|
|||||||
'Last 7 days': 'W',
|
'Last 7 days': 'W',
|
||||||
'Month to Date': 'M',
|
'Month to Date': 'M',
|
||||||
'Year to Date': 'Y',
|
'Year to Date': 'Y',
|
||||||
'Last 6 months': 'S',
|
'Last 12 months': 'L',
|
||||||
'Last 30 days': 'T',
|
'Last 30 days': 'T',
|
||||||
'All time': 'A',
|
'All time': 'A',
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user