Below is the JSON data that I have:
{
"Title": "Test",
"StartDate": {
"Month": "3",
"Year": "1973"
},
"EndDate": {
"Month": "4",
"Year": "1974"
}
}
I am looking to extract the Month
and Year
values from both StartDate
and EndDate
fields without quotes, as shown below:
{
"Title": "Test",
"StartDate": {
"Month": 3,
"Year": 1973
},
"EndDate": {
"Month": 4,
"Year": 1974
}
}
EDIT I want to clarify that I am not generating this JSON using JSON.stringify(). The JSON is being created by a Form Builder module in Angular 2. Despite specifying the type as number, the values are still encapsulated in quotes.