I balls’ed up on Prod, and learnt a new skill — MongoDB Compass

Basically, time zones suck but Mongo saved me from RSI.


The problem — 08/04/21 was the most important date?

Notice how the 8th April is repeated.

The fix — part 1

// Months are indexed 0-11
const month = date.getMonth() < 9 ? "0" + (date.getMonth() + 1) : date.getMonth();
// Dates are indexed 1-31
const day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();

The fix — part 2

Can you see it?

Founder of EveryHour.xyz and Product Owner @ dunnhumby; just genuinely interested in a lot of things. Built racecars, built electronics, now building software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store