Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce Y-m-d as date format for date fields #12408

Merged
merged 6 commits into from
Feb 15, 2023

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jan 24, 2023

These changes are mostly for the API, since the GUI handles dates via date picker and mostly won't let you make mistakes there. This came up because a discord user was using the API and tried to send 6/2/2022 as a purchase date, which was passing the looser date validation (since it is a valid date) but was being inserted into mysql very weirdly, since MySQL doesn't know what to do with that date, as it's expecting YYYY-MM-DD. This at least kicks back an error to prevent badly formatted data from creating inaccurate results.

Signed-off-by: snipe <snipe@snipe.net>
@what-the-diff
Copy link

what-the-diff bot commented Jan 24, 2023

  • Change the date format in Accessory, Asset, Component and Consumable models
  • Add purchase_date field to License model
  • Add expiration_date and termination_date fields to License model
  • Fix start/end dates for User Model (change from nullable|after:start_data)

Signed-off-by: snipe <snipe@snipe.net>
…te_format

Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
app/Models/Asset.php Outdated Show resolved Hide resolved
Signed-off-by: snipe <snipe@snipe.net>
@snipe snipe merged commit de4f7bd into develop Feb 15, 2023
@snipe snipe deleted the fixes/stricter_date_rectrictions_on_validation branch February 15, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants