BetterTimestamps: Trap toJSON so the native row bridge gets the formatted string

This commit is contained in:
Ally Founder 2026-08-08 01:48:50 -04:00
parent 6d872fd3b8
commit 213c5eecec
2 changed files with 2 additions and 2 deletions

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" || prop === "toString") {
if (prop === "format" || prop === "calendar" || prop === "fromNow" || prop === "toISOString" || prop === "toString" || prop === "toJSON") {
return getFormatted;
}
const value = target[prop];

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" || prop === "toString") {
if (prop === "format" || prop === "calendar" || prop === "fromNow" || prop === "toISOString" || prop === "toString" || prop === "toJSON") {
return getFormatted;
}
const value = target[prop];