Skip to content
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
19 changes: 12 additions & 7 deletions app/components/Landing/IntroHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { env } = useAppConfig().buildInfo
const activeNoodlesData = ACTIVE_NOODLES.map(noodle => ({
key: noodle.key,
date: noodle.date,
dateTo: noodle.dateTo,
timezone: noodle.timezone,
tagline: noodle.tagline,
}))
Expand Down Expand Up @@ -54,22 +55,26 @@ onPrehydrate(el => {
}

const currentActiveNoodles = activeNoodles.filter(noodle => {
const todayDate = new Intl.DateTimeFormat('en-US', {
const todayDate = new Date()
const todayDateRaw = new Intl.DateTimeFormat('en-US', {
timeZone: noodle.timezone === 'auto' ? undefined : noodle.timezone,
month: '2-digit',
day: '2-digit',
year: 'numeric',
}).format(new Date())
}).format(todayDate)

const noodleDate =
noodle.date &&
new Intl.DateTimeFormat('en-US', {
const noodleDateFrom = new Date(noodle.date!)
if (!noodle.dateTo) {
const noodleDateFromRaw = new Intl.DateTimeFormat('en-US', {
timeZone: noodle.timezone === 'auto' ? undefined : noodle.timezone,
month: '2-digit',
day: '2-digit',
year: 'numeric',
}).format(new Date(noodle.date))
return todayDate === noodleDate
}).format(noodleDateFrom)
return todayDateRaw === noodleDateFromRaw
}
const noodleDateTo = new Date(noodle.dateTo!)
return todayDate >= noodleDateFrom && todayDate <= noodleDateTo
})

if (!currentActiveNoodles.length) return
Expand Down
3 changes: 3 additions & 0 deletions app/components/Noodle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type Noodle = {
timezone?: string
// Date for the noodle
date?: string
// Date to for the noodle
dateTo?: string
// Logo for the noodle - could be any component. Relative parent - intro section
logo: Component
// Show npmx tagline or not (default is true)
Expand Down Expand Up @@ -41,6 +43,7 @@ export const ACTIVE_NOODLES: Noodle[] = [
key: 'artemis',
logo: NoodleArtemisLogo,
date: '2026-04-08T12:00:00Z',
dateTo: '2026-04-12T01:00:00Z',
timezone: 'America/Los_Angeles',
tagline: true,
},
Expand Down
Loading