Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix leap year bug, we don't care about the exact min and max dates

Roland Geider71f4f283fae0
diff --git a/wger/core/forms.py b/wger/core/forms.py
index a6f278c5e..ccf1d8e73 100644
--- a/wger/core/forms.py
+++ b/wger/core/forms.py
@@ -138,8 +138,8 @@ class UserPreferencesForm(forms.ModelForm):
widget=forms.DateInput(
attrs={
'type': 'date',
- 'max': str(date.today().replace(year=date.today().year - 10)),
- 'min': str(date.today().replace(year=date.today().year - 100)),
+ 'max': str(date(date.today().year - 10, 1, 1)),
+ 'min': str(date(date.today().year - 100, 1, 1)),
},
),
)