fix: GetSessions scan robuste (sql.NullString) + formatDate adaptatif
- Scan des colonnes datetime via sql.NullString au lieu de time.Time pour éviter les échecs silencieux dus aux formats mixtes SQLite (CURRENT_TIMESTAMP vs RFC3339) - Log explicite si un scan échoue (au lieu du continue silencieux) - formatDate frontend adapte le format SQLite "YYYY-MM-DD HH:MM:SS" en ISO pour new Date() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
95757124de
commit
1cbd7e9d17
2 changed files with 20 additions and 13 deletions
|
|
@ -686,9 +686,12 @@ document.addEventListener('alpine:init', () => {
|
|||
this.revoking = { ...this.revoking, [id]: false }
|
||||
},
|
||||
|
||||
formatDate(iso) {
|
||||
if (!iso) return '—'
|
||||
const d = new Date(iso)
|
||||
formatDate(raw) {
|
||||
if (!raw) return '—'
|
||||
// SQLite retourne "YYYY-MM-DD HH:MM:SS" ou RFC3339 selon le driver
|
||||
// new Date() gère les deux si on normalise le séparateur
|
||||
const d = new Date(raw.includes('T') ? raw : raw.replace(' ', 'T') + 'Z')
|
||||
if (isNaN(d.getTime())) return raw
|
||||
return d.toLocaleString('fr-FR', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' })
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue