DrillsGreen on your laptop, red in CI
Green on your laptop, red in CI
What happened
Kofi asked Cursor to show each invoice’s issue date in the customer’s own time zone. The new test passes on his laptop in Berlin every time. In CI it fails on every run, so the change can’t merge. The CI machines run Linux set to UTC, like Harbor’s production servers.
KofiIt’s green on my machine, three runs in a row. CI must be flaky. Can you re-run it until it passes? I’d like this merged today.
What you seeDeploy log
Run npm test
❯ src/invoices/format-date.test.js (1 test | 1 failed) 12ms
× shows the issue date in the account's time zone
FAIL src/invoices/format-date.test.js > formatInvoiceDate > shows the issue date in the account's time zone
AssertionError: expected '30 Nov 2026' to be '1 Dec 2026' // Object.is equality
❯ src/invoices/format-date.test.js:7:72
Error: Process completed with exit code 1.
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 the date your browser’s clock gives. The checks try customers in different time zones.
// Formats the issue date on Harbor invoices and in the invoice list.
// Each account has a time zone, like "Europe/Berlin", passed in as timeZone.
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
function formatInvoiceDate(iso, timeZone) {
const d = new Date(iso);
return `${d.getDate()} ${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
}
// Kelp Studio is billed from Berlin. Its November invoice was issued at 23:30 UTC on 30 November.
console.log(formatInvoiceDate("2026-11-30T23:30:00Z", "Europe/Berlin"));
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