Page MenuHomePhorge

D25618.1737232247.diff
No OneTemporary

D25618.1737232247.diff

diff --git a/src/view/form/control/AphrontFormDateControlValue.php b/src/view/form/control/AphrontFormDateControlValue.php
--- a/src/view/form/control/AphrontFormDateControlValue.php
+++ b/src/view/form/control/AphrontFormDateControlValue.php
@@ -97,7 +97,8 @@
return $value;
}
- $readable = $value->formatTime($epoch, 'Y!m!d!g:i A');
+ $dt = new DateTime("@$epoch");
+ $readable = $dt->format('Y!m!d!g:i A');
$readable = explode('!', $readable, 4);
$year = $readable[0];
diff --git a/src/view/viewutils.php b/src/view/viewutils.php
--- a/src/view/viewutils.php
+++ b/src/view/viewutils.php
@@ -132,8 +132,8 @@
try {
$date = new DateTime('@'.$epoch);
} catch (Exception $ex) {
- // NOTE: DateTime throws an empty exception if the format is invalid,
- // just replace it with a useful one.
+ // NOTE: Before PHP 8.3, DateTime throws an empty exception if the format
+ // is invalid, just replace it with a useful one.
throw new Exception(
pht("Construction of a DateTime() with epoch '%s' ".
"raised an exception.", $epoch));

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 18, 20:30 (18 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1109411
Default Alt Text
D25618.1737232247.diff (1 KB)

Event Timeline