diff --git a/src/components/Home/Jumbo.astro b/src/components/Home/Jumbo.astro
index e1fb930..7623598 100644
--- a/src/components/Home/Jumbo.astro
+++ b/src/components/Home/Jumbo.astro
@@ -15,6 +15,7 @@ const t = useTranslations(lang);
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
year: "numeric",
diff --git a/src/components/Schedule/Pages/ScheduleTab.astro b/src/components/Schedule/Pages/ScheduleTab.astro
index 763429c..8ff20aa 100644
--- a/src/components/Schedule/Pages/ScheduleTab.astro
+++ b/src/components/Schedule/Pages/ScheduleTab.astro
@@ -3,6 +3,7 @@ import type { ScheduleDay } from "../../../data/types/sessionize";
import { getLangFromUrl } from "../../../i18n/utils";
import ScheduleCard from "../ScheduleCard.astro";
import { capitalizeFirstLetter } from "../../../react/utils";
+import { WebsiteConfig } from "../../../config";
interface Props {
schedule: ScheduleDay[];
@@ -56,12 +57,12 @@ const calcSlotsTaken = (timeSlots, tsr, ts_idx) => {
const roomsSelected = rooms?s.rooms.filter((r) => rooms.includes(r.id)):s.rooms
const timeSlotSelected = s.timeSlots.filter((ts) => ts.rooms.some((tsr) => roomsSelected.map(r => r.id).includes(tsr.id)) || isServiceTimeSlot(ts));
const totalScheduleCols = roomsSelected.length;
- const totalScheduleRows = timeSlotSelected.length;
let skipPadding: {[key:string]:number} = roomsSelected.map((room) => ({[room.id]:0})).reduce((a,b)=>({...a,...b}),{});
return <>
{capitalizeFirstLetter(new Date(s.date).toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
weekday: "long",
@@ -107,7 +108,7 @@ const calcSlotsTaken = (timeSlots, tsr, ts_idx) => {
return [
-
{ts.slotStart.substring(0, 5)}
+
{ts.slotStart}
,
...orderedSessions
];
diff --git a/src/components/Sessions/Pages/SessionDetail.astro b/src/components/Sessions/Pages/SessionDetail.astro
index a29e0c6..2b03a22 100644
--- a/src/components/Sessions/Pages/SessionDetail.astro
+++ b/src/components/Sessions/Pages/SessionDetail.astro
@@ -6,6 +6,7 @@ import AddToCalendar from '../../Common/AddToCalendar.astro';
import BaseLayout from '../../Common/BaseLayout.astro';
import SessionTopic from '../SessionTopic.astro';
import { capitalizeFirstLetter } from "../../../react/utils";
+import { WebsiteConfig } from '../../../config';
interface Props {
entry: SessionInfo;
@@ -32,16 +33,19 @@ const dateEnd = new Date(entry.endsAt);
const isScheduled = dateStart.getTime() != 0;
var date = capitalizeFirstLetter(dateStart.toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "short",
}));
const start = dateStart.toLocaleTimeString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
hour: "numeric",
minute: "numeric",
});
const end = dateEnd.toLocaleTimeString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
hour: "numeric",
minute: "numeric",
});
diff --git a/src/components/Speakers/Pages/SpeakerDetail.astro b/src/components/Speakers/Pages/SpeakerDetail.astro
index 5bdceed..6f24fee 100644
--- a/src/components/Speakers/Pages/SpeakerDetail.astro
+++ b/src/components/Speakers/Pages/SpeakerDetail.astro
@@ -71,6 +71,7 @@ const pageTitle = `${speaker.fullName} @ ${WebsiteConfig.DEVFEST_NAME}`;
const dateEnd = new Date(session.endsAt);
const date = dateStart.toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
month: "long",
day: "numeric",
});
diff --git a/src/config.ts b/src/config.ts
index 577221d..cde38d9 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -22,6 +22,7 @@ export class WebsiteConfig {
public static readonly EVENT_START : Date = new Date('2024-10-26');
public static readonly EVENT_END : Date = new Date('2024-10-26');
+ public static readonly EVENT_TIMEZONE : string = 'Europe/Rome';
public static readonly EVENT_LOCATION_NAME : String = 'Polythecnic of Bari';
public static readonly EVENT_LOCATION_CITY : String = 'Bari';
public static readonly EVENT_LOCATION_ADDRESS : String = 'Via Edoardo Orabona 4';
diff --git a/src/data/api/sessionize_api.ts b/src/data/api/sessionize_api.ts
index e6d325d..bb663c2 100644
--- a/src/data/api/sessionize_api.ts
+++ b/src/data/api/sessionize_api.ts
@@ -1,3 +1,4 @@
+import { WebsiteConfig } from "../../config";
import type { ScheduleDay, SessionInfo, Speaker } from "../types/sessionize";
const API_ID = "1rh747m6"
@@ -19,12 +20,15 @@ export async function getSchedule(): Promise
> {
schedule.forEach(
day => day.timeSlots.forEach(
- slot => slot.rooms.forEach(
- room => {
- const sessionInfoFound = sessionsInfo.find((_s) => _s.id == room.session.id);
- room.session.info = sessionInfoFound;
- },
- ),
+ (slot, slot_idx) => {
+ day.timeSlots[slot_idx].slotStart = new Date(slot.rooms[0].session.startsAt).toLocaleString("it", {timeZone: WebsiteConfig.EVENT_TIMEZONE, hour:"numeric", minute:"numeric"})
+ slot.rooms.forEach(
+ room => {
+ const sessionInfoFound = sessionsInfo.find((_s) => _s.id == room.session.id);
+ room.session.info = sessionInfoFound;
+ },
+ )
+ }
),
);
diff --git a/src/pages/redirect/[url_encoded].astro b/src/pages/redirect/[url_encoded].astro
index b1a7a27..c7d140a 100644
--- a/src/pages/redirect/[url_encoded].astro
+++ b/src/pages/redirect/[url_encoded].astro
@@ -69,6 +69,7 @@ const t = useTranslations(lang);
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
year: "numeric",
diff --git a/src/pages/ticket.astro b/src/pages/ticket.astro
index 70ada61..c8e1d17 100644
--- a/src/pages/ticket.astro
+++ b/src/pages/ticket.astro
@@ -34,6 +34,7 @@ import { WebsiteConfig } from "../config"
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
year: "numeric",
diff --git a/src/react/pages/LoginPage.tsx b/src/react/pages/LoginPage.tsx
index ff9ca90..3e136c8 100644
--- a/src/react/pages/LoginPage.tsx
+++ b/src/react/pages/LoginPage.tsx
@@ -88,6 +88,7 @@ export const LoginPage = () => {
{
WebsiteConfig.EVENT_START.toLocaleDateString("en", {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
year: "numeric",
diff --git a/src/react/pages/SignupPage.tsx b/src/react/pages/SignupPage.tsx
index 89b2139..766e821 100644
--- a/src/react/pages/SignupPage.tsx
+++ b/src/react/pages/SignupPage.tsx
@@ -94,6 +94,7 @@ export const SignupPage = ({ token }: { token:string }) => {
{
WebsiteConfig.EVENT_START.toLocaleDateString("en", {
+ timeZone: WebsiteConfig.EVENT_TIMEZONE,
day: "numeric",
month: "long",
year: "numeric",