Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[candidate] Allow dob format Y-m (#8648)
When a dob Format of Ym (year and month without day) is set in the config module, candidates could not be created for 2 reasons. The wrong format (!Y-m-d) was being passed through the function DateTime::createFromFormat in the createNew function of the candidate class, which gave a wrong format error to the user even if they were passing through the expected format of Year-month Even if this was fixed, the date was inserted into the candidate table as YYYY-MM, but this is not compatible with the SQL Type date This fixes this issue by getting the date format from config, processing it to the right format and passing it through to DateTime::createFromFormat, as well as adding a '-15' to the end of the date if Ym format is selected in the configuration. This inserts the fifteenth of the month as the arbitrary date for a candidate. Resolves #8586
- Loading branch information