Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14389357
D12674.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
858 B
Referenced Files
None
Subscribers
None
D12674.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,22 @@
return null;
}
+ $colloquial = array(
+ 'elevenses' => '11:00 AM',
+ 'morning tea' => '11:00 AM',
+ 'noon' => '12:00 PM',
+ 'high noon' => '12:00 PM',
+ 'lunch' => '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
Sun, Dec 22, 5:31 PM (12 h, 19 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6919182
Default Alt Text
D12674.diff (858 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