Page MenuHomePhabricator

D12174.id29260.diff
No OneTemporary

D12174.id29260.diff

diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
@@ -66,16 +66,24 @@
$end_value = $end_time->readValueFromRequest($request);
$description = $request->getStr('description');
- try {
- $status
- ->setUserPHID($user->getPHID())
- ->setStatus($type)
- ->setDateFrom($start_value)
- ->setDateTo($end_value)
- ->setDescription($description)
- ->save();
- } catch (PhabricatorCalendarEventInvalidEpochException $e) {
- $errors[] = pht('Start must be before end.');
+ if ($start_time->getError()) {
+ $errors[] = pht('Invalid start time; reset to default.');
+ }
+ if ($end_time->getError()) {
+ $errors[] = pht('Invalid end time; reset to default.');
+ }
+ if (!$errors) {
+ try {
+ $status
+ ->setUserPHID($user->getPHID())
+ ->setStatus($type)
+ ->setDateFrom($start_value)
+ ->setDateTo($end_value)
+ ->setDescription($description)
+ ->save();
+ } catch (PhabricatorCalendarEventInvalidEpochException $e) {
+ $errors[] = pht('Start must be before end.');
+ }
}
if (!$errors) {

File Metadata

Mime Type
text/plain
Expires
Oct 17 2024, 7:44 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721207
Default Alt Text
D12174.id29260.diff (1 KB)

Event Timeline