Add third week meetings schedule

The openstacksdks team meets on the
third thursday of each month. We could
use a a monthly third-week option.

Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
Change-Id: I9eee4582506274a18e7146f6c241cf56fb585075
This commit is contained in:
Goutham Pacha Ravi 2021-02-11 17:24:05 -08:00
parent 17fc96295b
commit da7f28db56
5 changed files with 95 additions and 0 deletions

View File

@ -171,6 +171,14 @@ yaml2ical supports a number of possible frequency options:
* ``first-thursday``: On the first Thursday of the month.
* ``first-friday``: On the first Friday of the month.
* Event occurs in the third week of a month:
* ``third-monday``: On the third Monday of the month.
* ``third-tuesday``: On the third Tuesday of the month.
* ``third-wednesday``: On the third Wednesday of the month.
* ``third-thursday``: On the third Thursday of the month.
* ``third-friday``: On the third Friday of the month.
* Event doesn't happen on a defined schedule but is used as a placeholder for
html generation:

View File

@ -153,6 +153,11 @@ class Schedule(object):
'first-wednesday': set([0, 1, 2, 3]),
'first-thursday': set([0, 1, 2, 3]),
'first-friday': set([0, 1, 2, 3]),
'third-monday': set([0, 1, 2, 3]),
'third-tuesday': set([0, 1, 2, 3]),
'third-wednesday': set([0, 1, 2, 3]),
'third-thursday': set([0, 1, 2, 3]),
'third-friday': set([0, 1, 2, 3]),
}
return len(week[self.freq].intersection(week[other.freq])) > 0

View File

@ -254,4 +254,9 @@ supported_recurrences = {
'first-wednesday': MonthlyRecurrence(week=1, day='Wednesday'),
'first-thursday': MonthlyRecurrence(week=1, day='Thursday'),
'first-friday': MonthlyRecurrence(week=1, day='Friday'),
'third-monday': MonthlyRecurrence(week=3, day='Monday'),
'third-tuesday': MonthlyRecurrence(week=3, day='Tuesday'),
'third-wednesday': MonthlyRecurrence(week=3, day='Wednesday'),
'third-thursday': MonthlyRecurrence(week=3, day='Thursday'),
'third-friday': MonthlyRecurrence(week=3, day='Friday'),
}

View File

@ -446,3 +446,73 @@ chair: John Doe
description: >
Example Monthly meeting
"""
THIRD_MONDAY_MEETING = """
project: OpenStack Random Meeting
agenda_url: http://agenda.com/
project_url: http://project.com
schedule:
- time: '2200'
day: Monday
irc: openstack-meeting
frequency: third-monday
chair: John Doe
description: >
Example Monthly meeting
"""
THIRD_TUESDAY_MEETING = """
project: OpenStack Random Meeting
agenda_url: http://agenda.com/
project_url: http://project.com
schedule:
- time: '2200'
day: Tuesday
irc: openstack-meeting
frequency: third-tuesday
chair: John Doe
description: >
Example Monthly meeting
"""
THIRD_WEDNESDAY_MEETING = """
project: OpenStack Random Meeting
agenda_url: http://agenda.com/
project_url: http://project.com
schedule:
- time: '2200'
day: Wednesday
irc: openstack-meeting
frequency: third-wednesday
chair: John Doe
description: >
Example Monthly meeting
"""
THIRD_THURSDAY_MEETING = """
project: OpenStack Random Meeting
agenda_url: http://agenda.com/
project_url: http://project.com
schedule:
- time: '2200'
day: Thursday
irc: openstack-meeting
frequency: third-thursday
chair: John Doe
description: >
Example Monthly meeting
"""
THIRD_FRIDAY_MEETING = """
project: OpenStack Random Meeting
agenda_url: http://agenda.com/
project_url: http://project.com
schedule:
- time: '2200'
day: Friday
irc: openstack-meeting
frequency: third-friday
chair: John Doe
description: >
Example Monthly meeting
"""

View File

@ -98,6 +98,13 @@ class RecurrenceTestCase(unittest.TestCase):
self.next_meeting(rec),
)
def test_monthly_third_week(self):
rec = recurrence.MonthlyRecurrence(week=3, day='Thursday')
self.assertEqual(
datetime.datetime(2014, 11, 19, 2, 47, 28, 832666),
self.next_meeting(rec),
)
def test_monthly_invalid_week(self):
rec = recurrence.MonthlyRecurrence(week=6, day='Wednesday')
self.assertRaises(