@ -462,35 +462,36 @@ export default {
applyQuickDateRange ( range ) {
this . dateActionMenuIsOpen = false
const today = new Date ( )
let endDate = today
let startDate
let endDate
switch ( range ) {
case 'today' :
/ / F o r ' T o d a y ' , b o t h s t a r t a n d e n d a r e s e t t o t o d a y
startDate = today
startDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 0 , 0 , 0 , 0 )
endDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 23 , 59 , 59 , 999 )
this . dateFilter . text = t ( 'core' , 'Today' )
break
case '7days' :
/ / F o r ' L a s t 7 d a y s ' , s t a r t d a t e i s 7 d a y s a g o , e n d i s t o d a y
startDate = new Date ( today )
startDate . setDate ( today . getDate ( ) - 7 )
startDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) - 6 , 0 , 0 , 0 , 0 )
this . dateFilter . text = t ( 'core' , 'Last 7 days' )
break
case '30days' :
/ / F o r ' L a s t 3 0 d a y s ' , s t a r t d a t e i s 3 0 d a y s a g o , e n d i s t o d a y
startDate = new Date ( today )
startDate . setDate ( today . getDate ( ) - 30 )
startDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) - 29 , 0 , 0 , 0 , 0 )
this . dateFilter . text = t ( 'core' , 'Last 30 days' )
break
case 'thisyear' :
/ / F o r ' T h i s y e a r ' , s t a r t d a t e i s t h e f i r s t d a y o f t h e y e a r , e n d i s t o d a y
startDate = new Date ( today . getFullYear ( ) , 0 , 1 )
/ / F o r ' T h i s y e a r ' , s t a r t d a t e i s t h e f i r s t d a y o f t h e y e a r , e n d i s t h e l a s t d a y o f t h e y e a r
startDate = new Date ( today . getFullYear ( ) , 0 , 1 , 0 , 0 , 0 , 0 )
endDate = new Date ( today . getFullYear ( ) , 11 , 31 , 23 , 59 , 59 , 999 )
this . dateFilter . text = t ( 'core' , 'This year' )
break
case 'lastyear' :
/ / F o r ' L a s t y e a r ' , s t a r t d a t e i s t h e f i r s t d a y o f t h e p r e v i o u s y e a r , e n d i s t h e l a s t d a y o f t h e p r e v i o u s y e a r
startDate = new Date ( today . getFullYear ( ) - 1 , 0 , 1 )
endDate = new Date ( today . getFullYear ( ) - 1 , 11 , 31 )
startDate = new Date ( today . getFullYear ( ) - 1 , 0 , 1 , 0 , 0 , 0 , 0 )
endDate = new Date ( today . getFullYear ( ) - 1 , 11 , 31 , 23 , 59 , 59 , 999 )
this . dateFilter . text = t ( 'core' , 'Last year' )
break
case 'custom' :
@ -498,7 +499,6 @@ export default {
return
default :
return
}
this . dateFilter . startFrom = startDate
this . dateFilter . endAt = endDate