animation strip
This commit is contained in:
@@ -185,9 +185,9 @@
|
||||
|
||||
const target = Date.parse(`${param}T12:00:00Z`);
|
||||
if (Number.isNaN(target)) return;
|
||||
const today = new Date();
|
||||
today.setUTCHours(12, 0, 0, 0);
|
||||
const offset = Math.round((target - today.getTime()) / 86_400_000);
|
||||
const now = new Date();
|
||||
const todayNoon = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 12);
|
||||
const offset = Math.round((target - todayNoon) / 86_400_000);
|
||||
|
||||
if (offset < -3 || offset > 15) return; // out of reach: stay on today
|
||||
wantedDay = param;
|
||||
@@ -215,7 +215,7 @@
|
||||
const isToday = fetchedDaily
|
||||
? dayKey === formatZoned(new Date(), fetchedDaily.timezone, 'yyyy-MM-dd')
|
||||
: false;
|
||||
syncSearchParams($page.url, {
|
||||
syncSearchParams(get(page).url, {
|
||||
day: isToday ? null : dayKey,
|
||||
model: model && model !== 'best_match' ? model : null
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user