Autoload to check if a date is valid. Time
singlenton methods do bad error handling in my opinion, for example Time.get_unix_time_from_datetime_string
returns 0 if the date is invalid (but rigth format), but also if it recieves 1970-01-01. With this autoload, you can determine if the date is valid first before calling Time
methods.
Methods:
is_year_leap
. Determines is a year is leap.check_date
. Checks if a date is valid from its year, month and day asint
s. ReturnsOK
(0) if it is valid,FAILED
(1) otherwise.check_date_string
. Checks if a date is valid in ISO 8601 date string format (YYYY-MM-DD).check_date_dict
. Checks if a date is valid given aDictionary
.
I made some discussions on Godot repositories:
- Bad error handling.
- Proposal to implement what this addon does.
All non-Godot icons has been downloaded form Pictogrammers.