Get the latest tech news
JavaScript decided my day starts at 9am
TL;DR: new Date('2000-01-01') creates a date at midnight UTC, not local time. In Japan (UTC+9), that means 2000-01-01T09:00:00, so our dashboard filters missed all data created before 9AM.
We noticed something strange while fetching data for an admin dashboard: records created before 9AM were missing! Instead of letting new Date() assume UTC, explicitly set it to midnight. For filters, prefer constructing with year/month/day explicitly or append a local time.
Or read this on Hacker News