Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894803
D25618.1737232247.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25618.1737232247.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25618: Avoid search exception for calendar events when using localized time formats
Attached
Detach File
Event Timeline
Log In to Comment