I'm getting the following error when trying to pass a date object from AngularJS to java spring backend:
Failed to convert from type [java.lang.String] to type [@javax.persistence.Column java.sql.Timestamp] for value '2018-06-12T22:00:00.000Z'; nested exception is java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
So far I tried to format the date object to a string in the expected format:
$filter('date')(date, "yyyy-MM-dd hh:mm:ss");
which leads to an error telling:
Error: [ngModel:datefmt] Expected
2018-06-13 12:00:00to be a date
Seems like I need to pass a date object but I can't find a way to influence the date format AngularJS is attempting to convert to.
java.time.Instant, even without any formatter since the format is the default ISO 8601. How you persuade Spring into doing that and saving theInstantinto the database I don’t know (sorry). - Ole V.V.