Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15399096
D12954.id31196.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
D12954.id31196.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
@@ -23,8 +23,8 @@
if ($this->isCreate()) {
$event = PhabricatorCalendarEvent::initializeNewCalendarEvent($user);
- $end_value = AphrontFormDateControlValue::newFromEpoch($user, time());
- $start_value = AphrontFormDateControlValue::newFromEpoch($user, time());
+ list($start_value, $end_value) = $this->getDefaultTimeValues($user);
+
$submit_label = pht('Create');
$page_title = pht('Create Event');
$redirect = 'created';
@@ -349,4 +349,22 @@
return $new;
}
+ private function getDefaultTimeValues($user) {
+ $start = new DateTime('@'.time());
+ $start->setTimeZone($user->getTimeZone());
+
+ $start->setTime($start->format('H'), 0, 0);
+ $start->modify('+1 hour');
+ $end = id(clone $start)->modify('+1 hour');
+
+ $start_value = AphrontFormDateControlValue::newFromEpoch(
+ $user,
+ $start->format('U'));
+ $end_value = AphrontFormDateControlValue::newFromEpoch(
+ $user,
+ $end->format('U'));
+
+ return array($start_value, $end_value);
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 2:50 AM (1 w, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7381740
Default Alt Text
D12954.id31196.diff (1 KB)
Attached To
Mode
D12954: Make default start value of new events to be the next whole hour and the end value to be the next whole hour after that.
Attached
Detach File
Event Timeline
Log In to Comment