Hi. I'm working with some code that I inherited for a web app which maintains data for an apple farm, about the production and pallet storage. The very first HTML form allows for a Date/ Time picker.
The code leverages a PHP “framework” called GeoLib. I think that’s where the problem is, but i’m not sure. (liink to GeoLib http://geotonics.com/#geolib . )
This plugin interacts with a database for an apple farm about picking apples. At basically step 1 of this plugin’s functionality, it’s asking for a date of entry. The date picker is apparently where it’s breaking down. When the data is posted, the entered date is returned invalid. E.g.
"2022-01-09T15:31" is not a valid date.
I can change that value in the HTML input field to the following format (basically just removing the “T” before the Time, and putting it into 12-hr format… for whatever reason). Obviously, that defeats the purpose of the date picker. Changing the input field, manually after the error, and submitting again with the following format is accepted:
2022-01-09 03:31 PM
what date function should I use to "sanitize" that data so the data picker is satisfactory?