I am trying to find out a way of detecting any date when a model is saved. I want to manipulate the dates before they are saved. Each model has one or more date fields. Rather than going back and renaming them all to have something like FIELD-date where I can detect the "-date" in the field name, I thought I would try setting the model rule for the fields to a type of "date". But whenever I do this I always get an error when validating the data of "the format of FIELD is invalid". I tried MM/DD/YYYY, YYYY-MM-DD, MM/DD/YYYY HH:MM, and others. All return the same thing.
-
how do I get the model field type of date to work?
-
once I do this, will it set the data type of the variable for that field in the model to datetime or some other data type that can be checked?
-
if neither of the above pan out, is there some other recommendation for determining a date/datetime field when submitted?
Thanks