In a web application, I use twitter bootstrap; on the server side, I use spring REST.
I'm using bootstrap-datetimejs.
I use two different date formats.
$('#birthdatepicker').datetimepicker({
viewMode: 'years',
format: 'DD/MM/YYYY',
allowInputToggle: true
});
$('#expirationDateCard1, #expirationDateCard2').datetimepicker({
format: 'MM/YYYY'
});
When I post via ajax call, the response is:
"{"timestamp":1436453221365,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"Could not read document: Can not construct instance of java.util.Date from String value '09/07/2015': not a valid representation (error: Failed to parse Date value '09/07/2015': Can not parse date \"09/07/2015\": not compatible with any of standard forms (\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\", \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", \"EEE, dd MMM yyyy HH:mm:ss zzz\", \"yyyy-MM-dd\"))\n at [Source: java.io.PushbackInputStream@2e700ae1; line: 1, column: 83]
Are there some utilities to automatically do the conversion?