Records: format dates as YYYY-MM-DD for correct sort order
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b311092987
commit
2aa9e0fcdd
@ -8,7 +8,12 @@ function formatVal(val) {
|
||||
const s = String(val)
|
||||
if (DATE_RE.test(s)) {
|
||||
const d = new Date(s)
|
||||
if (!isNaN(d)) return d.toLocaleDateString(undefined, { year: '2-digit', month: 'short', day: 'numeric' })
|
||||
if (!isNaN(d)) {
|
||||
const y = d.getUTCFullYear()
|
||||
const m = String(d.getUTCMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getUTCDate()).padStart(2, '0')
|
||||
return `${y}-${m}-${day}`
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user