Parse.com - JSON Date Import Field Error
I am trying to import some JSON data into one of my tables at Parse.com. When doing this, I get the following error:
Import encountered the following error: error 111: Invalid type for key startDate, expected date but received string
Below is the data:
[
{
"title":"Software Webinar",
"location":"Kingsview Financial",
"host":"Josh Chase",
"startDate":"10/13/2014 12:30",
"EndDate":"10/13/2014 13:30",
"eventType":"TA",
"eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
}
]
I changed the date format a bit, but to no avail. Just trying to import some data and use JSON data for this. Thanks for any help.
+3
source to share
1 answer
Create your date like this:
"startDate": {
"__type": "Date",
"iso": "2014-10-13T12:30:00.000Z"
}
You JSON will look something like this:
[
{
"title":"Software Webinar",
"location":"Kingsview Financial",
"host":"Josh Chase",
"startDate": {
"__type": "Date",
"iso": "2014-10-13T12:30:00.000Z"
},
"EndDate": {
"__type": "Date",
"iso": "2014-10-13T13:30:00.000Z"
},
"eventType":"TA",
"eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
}
]
Hope this helps .. :)
+4
source to share