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

Allow editing event dates in languages which translate "AM"/"PM"

Summary:
Fixes the bug in the third paragraph of D25861#39133

Depends on D25861

Test Plan: Follow the test plan setup for D25861. Try to edit an event and see that you can now edit it normally and don't get "end date is invalid"/"start date is invalid" errors.

Reviewers: aklapper, O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26544

Pppery e7b40b85 76bdeb29

+9 -1
+9 -1
src/view/form/control/AphrontFormDateControlValue.php
··· 369 369 if (isset($colloquial[$normalized])) { 370 370 $time = $colloquial[$normalized]; 371 371 } 372 - 372 + // Convert localized times to English 373 + $am = pht('AM'); 374 + if ($am !== 'AM') { 375 + $time = preg_replace('/'.preg_quote($am).'$/', 'AM', $time); 376 + } 377 + $pm = pht('PM'); 378 + if ($pm !== 'PM') { 379 + $time = preg_replace('/'.preg_quote($pm).'$/', 'PM', $time); 380 + } 373 381 return $time; 374 382 } 375 383