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

Show festivals 3 hours earlier in the navigation #1967

Merged
merged 2 commits into from
Jan 28, 2025
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
5 changes: 4 additions & 1 deletion apps/web/app/[language]/festival/festivals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export interface FestivalInfo {

export function getActiveFestival(): FestivalInfo | undefined {
const now = new Date();
return festivals.find((festival) => isFestivalActive(festival, now));
const inThreeHours = new Date(now);
inThreeHours.setHours(inThreeHours.getHours() + 3);

return festivals.find((festival) => isFestivalActive(festival, now) || isFestivalActive(festival, inThreeHours));
}

export function getFestival(type: Festival): FestivalInfo | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { Event } from 'schema-dts';
import { absoluteUrl, getAlternateUrls } from '@/lib/url';
import { Festival, getFestival } from '../../festivals';
import ogImage from '../og.png';
import { ExternalLink } from '@gw2treasures/ui/components/Link/ExternalLink';

const ITEM_ENVELOPE = 68646;
const ITEM_DB_CHAMPION_ENVELOPE = 68647;
Expand Down Expand Up @@ -70,7 +71,10 @@ export default async function LunarNewYearPage({ params }: PageProps) {
return (
<PageLayout>
<ItemTableContext id="lunar-new-year">
<p><Trans id="festival.lunar-new-year.intro"/></p>
<p>
<Trans id="festival.lunar-new-year.intro"/>{' '}
If this is your first time participating or you just want a quick refresh, check out the YouTube video <ExternalLink href="https://www.youtube.com/watch?v=Eqg9No5Yo04">Get To The Point: A Lunar New Year for Guild Wars 2</ExternalLink> or read up on it on the <ExternalLink href="https://wiki.guildwars2.com/wiki/Lunar_New_Year">official Guild Wars 2 Wiki</ExternalLink>.
</p>
<p><Trans id="festival.lunar-new-year.description"/></p>
<Headline actions={<ItemTableColumnsButton/>} id="items"><Trans id="navigation.items"/></Headline>
<ItemTable query={{ where: { id: { in: itemIds }}}} defaultColumns={['item', 'rarity', 'type', 'buyPrice', 'buyPriceTrend', 'sellPrice', 'sellPriceTrend']}/>
Expand Down
Loading