Posted June 20, 201510 yr My Calendar widget (upcoming events) is always empty because all my events are "today" events. E.g. we've uploaded a new content for users and added a record to the Calendar.Could you add a settings to existing widget to shows not only upcoming events but also some events from the past? Edited June 20, 201510 yr by Andrey Gaisenok
June 20, 201510 yr Author I've looked at the code and made some changes, I added only one string to the fileapplications/calendar/widgets/upcomingEvents.php $_today = \IPS\calendar\Date::getDate( $this->_today->year, $this->_today->mon, 1); before string $events = \IPS\calendar\Event::retrieveEvents( $_today, $endDate, NULL, ( isset( $this->configuration['maximum_count'] ) AND $this->configuration['maximum_count'] > 0 ) ? $this->configuration['maximum_count'] : 5, FALSE ); So now I see all events for the month. But I will be glad if it will realized in the IPB code with an option.
June 20, 201510 yr Author I've found another solution:replace$events = \IPS\calendar\Event::retrieveEvents( $_today, $endDate, NULL, ( isset( $this->configuration['maximum_count'] ) AND $this->configuration['maximum_count'] > 0 ) ? $this->configuration['maximum_count'] : 5, FALSE );by$events = \IPS\calendar\Event::retrieveEvents( $_today->adjust( '-1 month' ), $endDate, NULL, ( isset( $this->configuration['maximum_count'] ) AND $this->configuration['maximum_count'] > 0 ) ? $this->configuration['maximum_count'] : 5, FALSE ); Simply, use $_today->adjust( '-1 month' ) instead $_today.
Archived
This topic is now archived and is closed to further replies.