[releng] Create all-day events rather than hour-long events
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [releng] Create all-day events rather than hour-long events
- Date: Fri, 24 Apr 2020 22:03:16 +0000 (UTC)
commit 5ce31100d2911d5900af086bc33e1fcb7bbb3bc6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Fri Apr 24 17:01:20 2020 -0500
Create all-day events rather than hour-long events
This will make it harder to fail to notice events that occur at midnight
or 2 AM or similarly odd times. Having a calendar event in the middle of
the night is not very useful for anyone who checks the calendar in the
morning, especially if using a day view.
tools/schedule/ical.py | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/tools/schedule/ical.py b/tools/schedule/ical.py
index 4e8082f..4f4fc28 100755
--- a/tools/schedule/ical.py
+++ b/tools/schedule/ical.py
@@ -15,12 +15,6 @@ cal.add('calscale').value = 'GREGORIAN'
now = datetime.datetime.utcnow()
utc = vobject.icalendar.utc
-# Evolution seems to need specific timezones otherwise the
-# alarms aren't set. However, haven't figured out how to create those
-# so that Evolution works.
-
-#mytz = dateutil.tz.tzoffset('FOO', 1)
-mytz = utc
for event in events:
vevent = cal.add('vevent')
@@ -37,12 +31,10 @@ for event in events:
desc.value = event.description
start = vevent.add('dtstart')
- start.value = datetime.datetime(event.date.year, event.date.month, event.date.day, 23, 00, tzinfo = mytz)
-# start.tzid_param = 'UTC' # Needed for Evolution
+ start.value = datetime.datetime(event.date.year, event.date.month, event.date.day)
stop = vevent.add('dtend')
- stop.value = datetime.datetime(event.date.year, event.date.month, event.date.day, 23, 59, 59, tzinfo =
mytz)
-# stop.tzid_param = 'UTC' # Needed for Evolution
+ stop.value = start.value + datetime.timedelta(days=1)
dtstamp = vevent.add('dtstamp')
dtstamp.value = now
@@ -54,10 +46,6 @@ for event in events:
x.value = summary.value
x = valarm.add('trigger')
-# x.related_param = 'START'
-# x.value_param = 'DURATION'
-# x.related_param = 'DATE-TIME'
-# x.value_param = 'DURATION'
if event.category == 'release':
x.value = start.value + datetime.timedelta(hours=-1)
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]