Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14834450
D12674.id30438.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
758 B
Referenced Files
None
Subscribers
None
D12674.id30438.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
@@ -179,6 +179,19 @@
return null;
}
+ $colloquial = array(
+ 'noon' => '12:00 PM',
+ 'high noon' => '12:00 PM',
+ 'tea time' => '3:00 PM',
+ 'witching hour' => '12:00 AM',
+ 'midnight' => '12:00 AM',
+ );
+
+ $normalized = phutil_utf8_strtolower($time);
+ if (isset($colloquial[$normalized])) {
+ $time = $colloquial[$normalized];
+ }
+
try {
$date = new DateTime("{$year}-{$month}-{$day} {$time}", $zone);
$value = $date->format('U');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 3:26 PM (14 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7078948
Default Alt Text
D12674.id30438.diff (758 B)
Attached To
Mode
D12674: Support colloquial time names to dramatically improve usability of time control
Attached
Detach File
Event Timeline
Log In to Comment