Page MenuHomePhabricator

D12674.diff
No OneTemporary

D12674.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
@@ -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

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)

Event Timeline