File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
1212import { LiveIcon } from "@python-italia/pycon-styleguide/icons" ;
1313import { SnakeWithPopcorn } from "@python-italia/pycon-styleguide/illustrations" ;
1414import { isAfter , isBefore , parseISO } from "date-fns" ;
15- import { zonedTimeToUtc } from "date-fns-tz" ;
15+ import { fromZonedTime } from "date-fns-tz" ;
1616import type React from "react" ;
1717import { FormattedMessage } from "react-intl" ;
1818
@@ -53,8 +53,8 @@ type Props = {
5353
5454const isEventLive = ( startTime : string , endTime : string ) => {
5555 const now = new Date ( ) ;
56- const utcStart = zonedTimeToUtc ( parseISO ( startTime ) , "Europe/Rome" ) ;
57- const utcEnd = zonedTimeToUtc ( parseISO ( endTime ) , "Europe/Rome" ) ;
56+ const utcStart = fromZonedTime ( parseISO ( startTime ) , "Europe/Rome" ) ;
57+ const utcEnd = fromZonedTime ( parseISO ( endTime ) , "Europe/Rome" ) ;
5858 return isAfter ( now , utcStart ) && isBefore ( now , utcEnd ) ;
5959} ;
6060
Original file line number Diff line number Diff line change 88} from "@python-italia/pycon-styleguide" ;
99import va from "@vercel/analytics" ;
1010import { isAfter , isBefore , parseISO } from "date-fns" ;
11- import { zonedTimeToUtc } from "date-fns-tz" ;
11+ import { fromZonedTime } from "date-fns-tz" ;
1212import React , {
1313 Fragment ,
1414 useCallback ,
@@ -437,11 +437,11 @@ export const findLiveSlot = ({
437437} ) : Slot | undefined => {
438438 const now = new Date ( ) ;
439439 return slots . find ( ( slot ) => {
440- const startHour = zonedTimeToUtc (
440+ const startHour = fromZonedTime (
441441 parseISO ( `${ currentDay } T${ slot . hour } ` ) ,
442442 "Europe/Rome" ,
443443 ) ;
444- const endHour = zonedTimeToUtc (
444+ const endHour = fromZonedTime (
445445 parseISO ( `${ currentDay } T${ slot . endHour } ` ) ,
446446 "Europe/Rome" ,
447447 ) ;
You can’t perform that action at this time.
0 commit comments