Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
d05be778
Unverified
Commit
d05be778
authored
Jan 11, 2017
by
Thom Wiggers
📐
Browse files
Also handle leap yaers in calendar api
parent
5a2eafd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/members/api/viewsets.py
View file @
d05be778
...
...
@@ -22,7 +22,13 @@ class MemberViewset(viewsets.ViewSet):
start_year
=
max
(
start
.
year
,
member
.
birthday
.
year
)
for
year
in
range
(
start_year
,
end
.
year
+
1
):
bday
=
copy
.
deepcopy
(
member
)
bday
.
birthday
=
bday
.
birthday
.
replace
(
year
=
year
)
try
:
bday
.
birthday
=
bday
.
birthday
.
replace
(
year
=
year
)
except
ValueError
as
e
:
if
bday
.
birthday
.
month
==
2
and
bday
.
birthday
.
day
==
29
:
bday
.
birthday
=
bday
.
birthday
.
replace
(
year
=
year
,
day
=
28
)
else
:
raise
e
if
start
.
date
()
<=
bday
.
birthday
<=
end
.
date
():
birthdays
.
append
(
bday
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment