@@ -63,7 +63,7 @@ const CalendarFetcherUtils = {
6363 event . start . tz = "" ;
6464 Log . debug ( `ical offset=${ current_offset } date=${ date } ` ) ;
6565 mm = moment ( date ) ;
66- let x = parseInt ( moment ( new Date ( ) ) . utcOffset ( ) ) ;
66+ let x = parseInt ( moment ( Date . now ( ) ) . utcOffset ( ) ) ;
6767 Log . debug ( `net mins=${ current_offset * 60 - x } ` ) ;
6868
6969 mm = mm . add ( x - current_offset * 60 , "minutes" ) ;
@@ -141,7 +141,7 @@ const CalendarFetcherUtils = {
141141 Log . debug ( `There are ${ Object . entries ( data ) . length } calendar entries.` ) ;
142142 Object . entries ( data ) . forEach ( ( [ key , event ] ) => {
143143 Log . debug ( "Processing entry..." ) ;
144- const now = new Date ( ) ;
144+ const now = Date . now ( ) ;
145145 const today = moment ( ) . startOf ( "day" ) . toDate ( ) ;
146146 const future
147147 = moment ( )
@@ -323,7 +323,7 @@ const CalendarFetcherUtils = {
323323
324324 // Get the offset of today where we are processing
325325 // This will be the correction, we need to apply.
326- let nowOffset = new Date ( ) . getTimezoneOffset ( ) ;
326+ let nowOffset = Date . now ( ) . getTimezoneOffset ( ) ;
327327 // For full day events, the time might be off from RRULE/Luxon problem
328328 // Get time zone offset of the rule calculated event
329329 let dateoffset = date . getTimezoneOffset ( ) ;
@@ -479,7 +479,7 @@ const CalendarFetcherUtils = {
479479 }
480480 } else {
481481 // It's not a fullday event, and it is in the past, so skip.
482- if ( ! fullDayEvent && endDate < new Date ( ) ) {
482+ if ( ! fullDayEvent && endDate < Date . now ( ) ) {
483483 return ;
484484 }
485485
0 commit comments