diff --git a/assets/js/dashboard/datepicker.js b/assets/js/dashboard/datepicker.js index c473e6d8597c..54cd05db7f47 100644 --- a/assets/js/dashboard/datepicker.js +++ b/assets/js/dashboard/datepicker.js @@ -292,17 +292,6 @@ function DatePicker({ query, site, history }) { opts.date = opts.date ? formatISO(opts.date) : false; - const keybinds = { - 'Today': 'D', - 'Realtime': 'R', - 'Last 7 days': 'W', - 'Month to Date': 'M', - 'Year to Date': 'Y', - 'Last 12 months': 'L', - 'Last 30 days': 'T', - 'All time': 'A', - }; - return ( {text} - {keybinds[text]} + + {opts.keybindHint ? ({opts.keybindHint}) : null} ); } @@ -329,23 +319,23 @@ function DatePicker({ query, site, history }) { font-medium text-gray-800 dark:text-gray-200 date-options" >
- {renderLink("day", "Today")} - {renderLink("realtime", "Realtime")} + {renderLink("day", "Today", { keybindHint: 'D' })} + {renderLink("realtime", "Realtime", { keybindHint: 'R' })}
- {renderLink("7d", "Last 7 Days")} - {renderLink("30d", "Last 30 Days")} + {renderLink("7d", "Last 7 Days", { keybindHint: 'W' })} + {renderLink("30d", "Last 30 Days", { keybindHint: 'T' })}
- {renderLink('month', 'Month to Date')} + {renderLink('month', 'Month to Date', { keybindHint: 'M' })} {renderLink('month', 'Last Month', { date: lastMonth(site) })}
- {renderLink("year", "Year to Date")} - {renderLink("12mo", "Last 12 months")} + {renderLink("year", "Year to Date", { keybindHint: 'Y' })} + {renderLink("12mo", "Last 12 months", { keybindHint: 'L' })}
- {renderLink("all", "All time")} + {renderLink("all", "All time", { keybindHint: 'A' })} setMode('calendar')} onKeyPress={() => setMode('calendar')}