import { md, mdi } from '../filters.ts'; const days = { 'friday': 0, 'saturday': 1, 'sunday': 2, }; const day = 24 * 60 * 60 * 1000; const week = 7 * day; const endOfWeekend = 2 * day; const getStartAndEnd = (date) => { const [ version, year ] = date.name.split(' '); const startingMonth = { Winter: 1, Spring: 4, Summer: 7, Autumn: 10, }[version]; // We start searching on the 20th of that specific month const d = new Date(); d.setFullYear(parseInt(year, 10)); d.setMonth(startingMonth - 1); d.setDate(20); for (let i = 0; i < 14; i++) { const dateToTry = new Date(d.valueOf() + (i * day)); if (dateToTry.getDay() !== 5) { continue; } const oneWeekLater = new Date(dateToTry.valueOf() + week); if (dateToTry.getMonth() === oneWeekLater.getMonth()) { continue; } return { start: dateToTry, end: new Date(dateToTry.valueOf() + endOfWeekend), }; } }; export default ({ data, lang, className }) => { const strings = data.strings; const dates = data.dates; const t = (o) => o?.[lang] || ''; return

{t(strings.comingDates)}

; };