Fix form submission issues and add Excel download functionality

This commit is contained in:
denisacirstea
2025-09-17 12:38:32 +03:00
parent 3bb09839ae
commit de966ede2b
5 changed files with 146 additions and 76 deletions

View File

@@ -101,6 +101,14 @@ def calculate_years(starting_date, duration):
day, month, year = map(int, starting_date.split('/'))
elif '.' in starting_date:
day, month, year = map(int, starting_date.split('.'))
elif '-' in starting_date:
# Handle ISO format (yyyy-mm-dd)
date_parts = starting_date.split('-')
if len(date_parts) == 3:
year, month, day = map(int, date_parts)
else:
# Default to current date if format is not recognized
return default_years
else:
# If format is not recognized, return default
return default_years