@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support colloquial time names to dramatically improve usability of time control

Summary: Ref T8024. The time control currently does not support colloquial time names frequently used in common parlance. Support these times.

Test Plan: Easily specified many of the most important times in a convenient way.

Reviewers: btrahan, chad, lpriestley

Reviewed By: lpriestley

Subscribers: johnny-bit, eadler, epriestley

Maniphest Tasks: T8024

Differential Revision: https://secure.phabricator.com/D12674

+16
+16
src/view/form/control/AphrontFormDateControlValue.php
··· 179 179 return null; 180 180 } 181 181 182 + $colloquial = array( 183 + 'elevenses' => '11:00 AM', 184 + 'morning tea' => '11:00 AM', 185 + 'noon' => '12:00 PM', 186 + 'high noon' => '12:00 PM', 187 + 'lunch' => '12:00 PM', 188 + 'tea time' => '3:00 PM', 189 + 'witching hour' => '12:00 AM', 190 + 'midnight' => '12:00 AM', 191 + ); 192 + 193 + $normalized = phutil_utf8_strtolower($time); 194 + if (isset($colloquial[$normalized])) { 195 + $time = $colloquial[$normalized]; 196 + } 197 + 182 198 try { 183 199 $date = new DateTime("{$year}-{$month}-{$day} {$time}", $zone); 184 200 $value = $date->format('U');