@@ -101,7 +101,7 @@ function renderArrow(query, site, period, prevDate, nextDate) {
101101 ) ;
102102}
103103
104- function DatePickerArrows ( { site, query} ) {
104+ function DatePickerArrows ( { site, query } ) {
105105 if ( query . period === "year" ) {
106106 const prevDate = formatISO ( shiftMonths ( query . date , - 12 ) ) ;
107107 const nextDate = formatISO ( shiftMonths ( query . date , 12 ) ) ;
@@ -122,7 +122,7 @@ function DatePickerArrows({site, query}) {
122122 return null
123123}
124124
125- function DisplayPeriod ( { query, site} ) {
125+ function DisplayPeriod ( { query, site } ) {
126126 if ( query . period === "day" ) {
127127 if ( isToday ( site , query . date ) ) {
128128 return "Today" ;
@@ -154,7 +154,7 @@ function DisplayPeriod({query, site}) {
154154 return 'Realtime'
155155}
156156
157- function DatePicker ( { query, site, history} ) {
157+ function DatePicker ( { query, site, history } ) {
158158 const [ open , setOpen ] = useState ( false )
159159 const [ mode , setMode ] = useState ( 'menu' )
160160 const dropDownNode = useRef ( null )
@@ -208,21 +208,21 @@ function DatePicker({query, site, history}) {
208208 setOpen ( false ) ;
209209
210210 const keybindings = {
211- d : { date : false , period : 'day' } ,
212- e : { date : formatISO ( shiftDays ( nowForSite ( site ) , - 1 ) ) , period : 'day' } ,
213- r : { period : 'realtime' } ,
214- w : { date : false , period : '7d' } ,
215- m : { date : false , period : 'month' } ,
216- y : { date : false , period : 'year' } ,
217- t : { date : false , period : '30d' } ,
218- s : { date : false , period : '6mo' } ,
219- l : { date : false , period : '12mo' } ,
220- a : { date : false , period : 'all' } ,
211+ d : { date : false , period : 'day' } ,
212+ e : { date : formatISO ( shiftDays ( nowForSite ( site ) , - 1 ) ) , period : 'day' } ,
213+ r : { period : 'realtime' } ,
214+ w : { date : false , period : '7d' } ,
215+ m : { date : false , period : 'month' } ,
216+ y : { date : false , period : 'year' } ,
217+ t : { date : false , period : '30d' } ,
218+ s : { date : false , period : '6mo' } ,
219+ l : { date : false , period : '12mo' } ,
220+ a : { date : false , period : 'all' } ,
221221 }
222222
223223 const redirect = keybindings [ e . key . toLowerCase ( ) ]
224224 if ( redirect ) {
225- navigateToQuery ( history , query , { ...newSearch , ...redirect } )
225+ navigateToQuery ( history , query , { ...newSearch , ...redirect } )
226226 } else if ( e . key . toLowerCase ( ) === 'x' ) {
227227 toggleComparisons ( history , query , site )
228228 } else if ( e . key . toLowerCase ( ) === 'c' ) {
@@ -240,7 +240,7 @@ function DatePicker({query, site, history}) {
240240 } )
241241
242242 useEffect ( ( ) => {
243- if ( mode === 'calendar' && open ) {
243+ if ( mode === 'calendar' && open ) {
244244 openCalendar ( )
245245 }
246246 } , [ mode ] )
@@ -260,9 +260,9 @@ function DatePicker({query, site, history}) {
260260 [ from , to ] = [ parseNaiveDate ( from ) , parseNaiveDate ( to ) ]
261261
262262 if ( from . isSame ( to ) ) {
263- navigateToQuery ( history , query , { period : 'day' , date : formatISO ( from ) , from : false , to : false } )
263+ navigateToQuery ( history , query , { period : 'day' , date : formatISO ( from ) , from : false , to : false } )
264264 } else {
265- navigateToQuery ( history , query , { period : 'custom' , date : false , from : formatISO ( from ) , to : formatISO ( to ) } )
265+ navigateToQuery ( history , query , { period : 'custom' , date : false , from : formatISO ( from ) , to : formatISO ( to ) } )
266266 }
267267 }
268268
@@ -305,10 +305,10 @@ function DatePicker({query, site, history}) {
305305
306306 return (
307307 < QueryLink
308- to = { { from : false , to : false , period, ...opts } }
308+ to = { { from : false , to : false , period, ...opts } }
309309 onClick = { ( ) => setOpen ( false ) }
310310 query = { query }
311- className = { `${ boldClass } px-4 py-2 text-sm leading-tight hover:bg-gray-100 hover:text-gray-900
311+ className = { `${ boldClass } px-4 py-2 text-sm leading-tight hover:bg-gray-100 hover:text-gray-900
312312 dark:hover:bg-gray-900 dark:hover:text-gray-100 flex items-center justify-between` }
313313 >
314314 { text }
@@ -333,12 +333,12 @@ function DatePicker({query, site, history}) {
333333 { renderLink ( "realtime" , "Realtime" ) }
334334 </ div >
335335 < div className = "py-1 border-b border-gray-200 dark:border-gray-500 date-option-group" >
336- { renderLink ( "7d" , "Last 7 days " ) }
337- { renderLink ( "30d" , "Last 30 days " ) }
336+ { renderLink ( "7d" , "Last 7 Days " ) }
337+ { renderLink ( "30d" , "Last 30 Days " ) }
338338 </ div >
339339 < div className = "py-1 border-b border-gray-200 dark:border-gray-500 date-option-group" >
340- { renderLink ( 'month' , 'Month to Date' ) }
341- { renderLink ( 'month' , 'Last month ' , { date : lastMonth ( site ) } ) }
340+ { renderLink ( 'month' , 'Month to Date' ) }
341+ { renderLink ( 'month' , 'Last Month ' , { date : lastMonth ( site ) } ) }
342342 </ div >
343343 < div className = "py-1 border-b border-gray-200 dark:border-gray-500 date-option-group" >
344344 { renderLink ( "year" , "Year to Date" ) }
@@ -358,22 +358,22 @@ function DatePicker({query, site, history}) {
358358 aria-expanded = "false"
359359 aria-controls = "calendar"
360360 >
361- Custom range
361+ Custom Range
362362 < span className = 'font-normal' > C</ span >
363363 </ span >
364364 </ div >
365- { ! COMPARISON_DISABLED_PERIODS . includes ( query . period ) &&
365+ { ! COMPARISON_DISABLED_PERIODS . includes ( query . period ) &&
366366 < div className = "py-1 date-option-group border-t border-gray-200 dark:border-gray-500" >
367367 < span
368368 onClick = { ( ) => {
369369 toggleComparisons ( history , query , site )
370370 setOpen ( false )
371371 } }
372372 className = "px-4 py-2 text-sm leading-tight hover:bg-gray-100 dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-gray-100 cursor-pointer flex items-center justify-between" >
373- { isComparisonEnabled ( query . comparison ) ? 'Disable comparison' : 'Compare' }
373+ { isComparisonEnabled ( query . comparison ) ? 'Disable comparison' : 'Compare' }
374374 < span className = 'font-normal' > X</ span >
375375 </ span >
376- </ div > }
376+ </ div > }
377377 </ div >
378378 </ div >
379379 ) ;
@@ -388,7 +388,8 @@ function DatePicker({query, site, history}) {
388388 minDate : site . statsBegin ,
389389 showMonths : 1 ,
390390 static : true ,
391- animate : true } }
391+ animate : true
392+ } }
392393 ref = { calendar }
393394 className = "invisible"
394395 onClose = { setCustomDate }
0 commit comments