StoicBuilder
Later missionMission 7: Red text is only a reportYou can practise it now. It counts once you reach mission 7, after “Why the spinner comes first”.Back to HQ

DrillsMy 7:30 pm tick landed on tomorrow

My 7:30 pm tick landed on tomorrow

I the LudusHabit tracker, built with ReplitSteadyAbout 5 minPro

What happened

You're building a habit tracker for the December challenge with Replit. It's Saturday 5 December, 7:30 pm in New York, and you tick off today's run. The calendar puts the tick on Sunday the 6th and leaves today empty, so your streak breaks.

Your sister in Tokyo, who's testing itMine does the opposite. Every morning before 9 it ticks yesterday.
What you seeOn screen
Ticked 2026-12-06. Ticks: 2026-12-03, 2026-12-04, 2026-12-06

The MagisterRun it first and read what comes back. Then change the code if you like: your edits go to the review too.

Run it to see where the tick lands. The last check also calls todayKey(date, timeZone) for Tokyo and Los Angeles.

// Habit tracker: tick off today. On the live page, now is new Date() and the time
// zone comes from the browser. Here both are fixed so every run gives the same answer.
const now = new Date("2026-12-05T19:30:00-05:00"); // Saturday 5 Dec, 7:30 pm in New York
const timeZone = "America/New_York";

const ticks = new Set(["2026-12-03", "2026-12-04"]);

// Today's date as a key like "2026-12-05", in the user's time zone.
function todayKey(now, timeZone) {
  return now.toISOString().slice(0, 10);
}

const today = todayKey(now, timeZone);
ticks.add(today);
console.log(`Ticked ${today}. Ticks: ${[...ticks].join(", ")}`);

The code runs in your browser against stand-in data. Nothing is sent anywhere.

Your answer

Reviewed by AI against what a good fix needs. About 10 seconds.

Sign in to get your answer reviewed

It's free. Anything you've typed here stays in this browser and is waiting when you come back.

Sign in with email