File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -336,9 +336,13 @@ export const computeRelativeEventDateRange = (
336336 } ;
337337} ;
338338
339- export const computeSomedayEventsRequestFilter = ( start : Dayjs ) => {
339+ export const computeSomedayEventsRequestFilter = (
340+ start : Dayjs ,
341+ end ?: Dayjs ,
342+ ) => {
340343 const startDate = start . subtract ( 1 , "month" ) . endOf ( "month" ) ;
341- const endDate = start . endOf ( "month" ) . add ( 1 , "week" ) ;
344+ const validEnd = end ?. isAfter ( start ) ?? false ;
345+ const endDate = validEnd ? end ! : start . endOf ( "month" ) . add ( 1 , "week" ) ;
342346
343347 return {
344348 startDate : toUTCOffset ( startDate ) ,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export const useRefresh = () => {
4343 case Sync_AsyncStateContextReason . SOCKET_SOMEDAY_EVENT_CHANGED : {
4444 const { startDate, endDate } = computeSomedayEventsRequestFilter (
4545 dayjs ( start ) ,
46+ dayjs ( end ) ,
4647 ) ;
4748
4849 dispatch (
You can’t perform that action at this time.
0 commit comments