BetterTimestamps: Intercept toString for string-coerced timestamps

This commit is contained in:
Rosie Val 2026-08-08 00:27:50 -04:00
parent ff50efbdf9
commit 615cbd2a08

View file

@ -10,7 +10,7 @@ function wrapTimestamp(original: any): any {
if (typeof Proxy === "undefined") return getFormatted();
return new Proxy(original, {
get(target, prop) {
if (prop === "format" || prop === "calendar" || prop === "fromNow" || prop === "toISOString") {
if (prop === "format" || prop === "calendar" || prop === "fromNow" || prop === "toISOString" || prop === "toString") {
return getFormatted;
}
const value = target[prop];