Skip to content

Commit

Permalink
testing calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Diaz committed Oct 26, 2018
1 parent ea2cbd9 commit 195d7e4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions genweb/organs/portlets/portlet_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,27 +235,29 @@ def next3Events(self):
self.request.form['day'])
dateEvent = datetime.strptime(date, formatDate)
# Shows only specified date
date_events = {'query': (dateEvent, dateEvent), 'range': 'min:max'}
date_events = {'query': (dateEvent, dateEvent), 'range': 'min'}
limit = 1
else:
# TODO....
# Future, show 3 events
date = datetime.today().strftime(formatDate)
dateEvent = datetime.strptime(date, formatDate)
date_events = {'query': (dateEvent), 'range': 'min'}
limit = 3
portal_catalog = getToolByName(self.context, 'portal_catalog')
if api.user.is_anonymous():
future_sessions = portal_catalog.unrestrictedSearchResults(
portal_type='genweb.organs.sessio',
sort_on='start',
start=date_events,
path=self.get_public_organs_fields()
)[:3]
)[:limit]
else:
future_sessions = portal_catalog.unrestrictedSearchResults(
portal_type='genweb.organs.sessio',
sort_on='start',
start=date_events,
)[:3]
)[:limit]

future = []
current_year = datetime.now().strftime('%Y')
Expand Down

0 comments on commit 195d7e4

Please sign in to comment.