Format a Date as a YYYY-MM-DD string.
Replaces the verbose getFullYear() + '-' + padStart(getMonth()+1) + ... pattern
that was duplicated across 30+ call sites.
Parameters
date: Date
Date object (interpreted in UTC unless inTimezone is provided)
OptionalinTimezone: string
Optional IANA timezone — formats the date as seen in that timezone
Format a Date as a YYYY-MM-DD string. Replaces the verbose
getFullYear() + '-' + padStart(getMonth()+1) + ...pattern that was duplicated across 30+ call sites.