Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: time start-end timezone #33

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .astro/astro/content.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,5 @@ declare module 'astro:content' {

type AnyEntryMap = ContentEntryMap & DataEntryMap;

export type ContentConfig = typeof import("./../../src/content/config.js");
export type ContentConfig = typeof import("../../src/content/config.js");
}
14 changes: 11 additions & 3 deletions src/components/Speakers/Pages/SpeakerDetail.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import SpeakersLinks from "../../../components/Speakers/SpeakersLinks.astro";
import { WebsiteConfig } from "../../../config";
import { getLangFromUrl, useTranslatedPath, useTranslations } from "../../../i18n/utils";
import { type Speaker } from "../../../data/types/sessionize";
import { formatTime } from "../../../helpers/time";
import SessionTopic from "../../Sessions/SessionTopic.astro";
import { getSpeakers } from "../../../data/repositories/sessionize_repository";
// 1. Generate a new path for every collection speaker
Expand Down Expand Up @@ -75,8 +74,17 @@ const pageTitle = `${speaker.fullName} @ ${WebsiteConfig.DEVFEST_NAME}`;
month: "long",
day: "numeric",
});
const startTime = formatTime(dateStart);
const endTime = formatTime(dateEnd);
const startTime = dateStart.toLocaleTimeString(lang, {
timeZone: WebsiteConfig.EVENT_TIMEZONE,
hour: "numeric",
minute: "numeric",
});

const endTime = dateEnd.toLocaleTimeString(lang, {
timeZone: WebsiteConfig.EVENT_TIMEZONE,
hour: "numeric",
minute: "numeric",
});
const isScheduled = dateStart.getTime() > 0;
return (
<a class="flex flex-col" href={getPath(`/sessions/${session.slug}`)}>
Expand Down
9 changes: 0 additions & 9 deletions src/helpers/time.ts

This file was deleted.