Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Calendar/Calendar.module
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class Calendar extends WireData implements Module {
$event_end_timestamp = (int)$e->getUnformatted(self::EVENT_END_FIELD);

// start/end DateTime objects
$start_datetime = new DateTime();
$start_datetime = new \DateTime();
$start_datetime->setTimestamp($event_start_timestamp);

$end_datetime = new DateTime();
$end_datetime = new \DateTime();
$end_datetime->setTimestamp($event_end_timestamp);

// generate recurrences by the RRULE
Expand Down
9 changes: 7 additions & 2 deletions ProcessCalendarAdmin/ProcessCalendarAdmin.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.CalendarAdmin-loading {
background: #ffffff 10px 10px no-repeat url('images/ajax-loader.gif');
background: #ffffff 10px 10px no-repeat url("images/ajax-loader.gif");
margin-left: 42px;
line-height: 52px;
}
Expand Down Expand Up @@ -60,6 +60,11 @@
#CalendarAdmin-edit-event-dialog {
display: none;
padding: 15px;
text-align: center;
}

.ui-dialog-buttonpane.ui-widget-content .ui-dialog-buttonset {
text-align: center;
}

/* notifications */
Expand All @@ -71,6 +76,6 @@
#CalendarAdmin-notification.success {
background: #ddffdd;
}
#CalendarAdmin-notification.error{
#CalendarAdmin-notification.error {
background: #ffdddd;
}
8 changes: 4 additions & 4 deletions ProcessCalendarAdmin/ProcessCalendarAdmin.module
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class ProcessCalendarAdmin extends Process {
<label for="title">Title</label>
<input type="text" name="title" id="ca-ned-title" />
<label for="starttime">Start</label>
<input type="text" name="starttime" id="ca-ned-starttime" placeholder="HH:MM" />
<input type="time" name="starttime" id="ca-ned-starttime" />
<label for="endtime">End</label>
<input type="text" name="endtime" id="ca-ned-endtime" placeholder="HH:MM" />
<input type="time" name="endtime" id="ca-ned-endtime"/>
</fieldset>
</div>

Expand Down Expand Up @@ -159,8 +159,8 @@ HTML;
$end_input = $input->get('end');

// start / end dates
$start = new DateTime($start_input);
$end = new DateTime($end_input);
$start = new \DateTime($start_input);
$end = new \DateTime($end_input);

// generate a list of json events for fullcalendar
return $this->outputJsonEvents($start, $end);
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ array(start, end, page)
// get module
$calendar = wire('modules')->getModule('Calendar');
// get upcoming events - 6 months ahead
$start = new DateTime();
$until = new DateTime();
$until->add(new DateInterval('P6M'));
$start = new \DateTime();
$until = new \DateTime();
$until->add(new \DateInterval('P6M'));
$events = $calendar->expandEvents($start, $until);
// render event
echo '<table>';
Expand Down