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
Sat, May 18, 8:09 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6300118
Default Alt Text
D12674.diff (858 B)

Event Timeline