Technical notes on web development, DevOps, and AI integration.
1 article
Data right, display wrong: toLocaleString without timeZone lets a UTC server and a WIB browser render different dates. Pin it at the presentation layer.
TL;DR: A date bug blamed on stored data was actually the render layer: toLocaleString was called with the id-ID locale but no timeZone option, so servers in UTC and browsers in WIB disagreed. Timestamps between 17:00 and 24:00 UTC crossed midnight once converted. Fix: store UTC, render with an explicit timeZone, locked by a test.