forked from indymedia/epicyon
Optionally supply day of month
parent
2d9ceb21c4
commit
4e6a8c11a5
|
@ -3672,14 +3672,17 @@ def getCalendarEvents(baseDir: str,nickname: str,domain: str,year: int,monthNumb
|
||||||
|
|
||||||
return events
|
return events
|
||||||
|
|
||||||
def getTodaysEvents(baseDir: str,nickname: str,domain: str) -> {}:
|
def getTodaysEvents(baseDir: str,nickname: str,domain: str,dayOfMonth=None) -> {}:
|
||||||
"""Retrieves calendar events for today
|
"""Retrieves calendar events for today
|
||||||
Returns a dictionary of lists containing Event and Place activities
|
Returns a dictionary of lists containing Event and Place activities
|
||||||
"""
|
"""
|
||||||
now=datetime.now()
|
now=datetime.now()
|
||||||
year=now.year
|
year=now.year
|
||||||
monthNumber=now.month
|
monthNumber=now.month
|
||||||
dayNumber=now.day
|
if not dayOfMonth:
|
||||||
|
dayNumber=now.day
|
||||||
|
else:
|
||||||
|
dayNumber=dayOfMonth
|
||||||
calendarFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/calendar/'+str(year)+'/'+str(monthNumber)+'.txt'
|
calendarFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/calendar/'+str(year)+'/'+str(monthNumber)+'.txt'
|
||||||
events={}
|
events={}
|
||||||
if not os.path.isfile(calendarFilename):
|
if not os.path.isfile(calendarFilename):
|
||||||
|
|
Loading…
Reference in New Issue