angular2-jsonapi
angular2-jsonapi copied to clipboard
DateConverter changed implementation on v8.2.1
Hello,
Can you please indicate an idea how to solve the problem of DateConverter implementation in version 8 as after updating from v6, our application has lots of breaking issues.
For example if we get undefined value for a Date property, the:
Initially, the implementation of date.converter.js for unmask was:
import { format, parse } from 'date-fns';
unmask(value: any) { return format(value, 'YYYY-MM-DDTHH:mm:ssZ'); // with Undefined it was OK }
Now:
DateConverter.prototype.unmask = /**
* @param {?} value
* @return {?}
*/
function (value) {
return value.toISOString(); // with Undefined it is NOT OK :(
};
Thanks for any suggestion!
It's a very big problem. With that issue it's not possible to deal with nullable datetime value.... Big issue....
Maybe @frans-beech-it could adjust his pull request, to not only handle null
but also undefined
values: https://github.com/ghidoz/angular2-jsonapi/pull/252.
But since it seems, that it will take some time until this is merged, you could got with the solution documented here: https://github.com/ghidoz/angular2-jsonapi/issues/242#issuecomment-532276090
In the end this is what I did, after searching more! Thanks for the feedback. I didn't expected to have this issue on upgrading the library; good that we have managed to fix all the breaking changes.