Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13966359
D12174.id29260.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12174.id29260.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12174: Calendar - error better with invalid time values
Attached
Detach File
Event Timeline
Log In to Comment