Skip to content

Commit e554aef

Browse files
committed
Fix date handling in KyteErrorController to support both Unix timestamps and formatted strings
1 parent 48b6e16 commit e554aef

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Mvc/Controller/KyteErrorController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ public function hook_response_data($method, $o, &$r = null, &$d = null) {
148148

149149
// Add human-readable date
150150
if (isset($o->date_created)) {
151-
$o->date_created_formatted = date($this->dateformat, $o->date_created);
151+
// Handle both Unix timestamps (integer) and already-formatted strings
152+
if (is_numeric($o->date_created)) {
153+
$o->date_created_formatted = date($this->dateformat, $o->date_created);
154+
} else {
155+
// Already formatted, use as-is
156+
$o->date_created_formatted = $o->date_created;
157+
}
152158
}
153159
}
154160
}

0 commit comments

Comments
 (0)