We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
From my backend i retrieve a date as a string, i would like to make it a Date object in my frontend. The following 2 options do NOT work:
@JsonProperty('date') Date: Date;
@JsonProperty({clazz: Date, name: 'date'}) Date: Date;
Any ideas or is this not possible?
The text was updated successfully, but these errors were encountered:
You should use a "customConverter" :
const dateConverter: ICustomConverter = { fromJson(data: any): any { return new Date(data); }, toJson(data: any): any { return 'some-date'; } };
@JsonProperty({name: 'dob', customConverter: dateConverter}) dateOfBirth: Date = undefined;
Sorry, something went wrong.
No branches or pull requests
Hi,
From my backend i retrieve a date as a string, i would like to make it a Date object in my frontend. The following 2 options do NOT work:
@JsonProperty('date')
Date: Date;
@JsonProperty({clazz: Date, name: 'date'})
Date: Date;
Any ideas or is this not possible?
The text was updated successfully, but these errors were encountered: