I am using the HTTP api for bringing data from erpnext, and I need to display the events in a particular date. I have tried using the filters parameter, it normally works with fields like subject and event_type, but doesn't work when I compare with Starts_on or Ends_on fields.
{
"data": [
{
"Ends_on": null,
"all_day": 1,
"Starts_on": "2014-07-17 12:00:00",
"Event_type": "Private",
"Subject": "fgsdfgvdgfdgfdgf"
},
{
"Ends_on": "2014-07-31 12:00:00",
"all_day": null,
"Starts_on": "2014-07-11 06:00:00",
"Event_type": "Public",
"Subject": "RGFVDGFDGFD"
},
{
"Ends_on": "2014-07-24 12:00:00",
"all_day": null,
"Starts_on": "2014-07-09 12:00:00",
"Event_type": "Public",
"Subject": "itiash pitiAHS"
},
{
"Ends_on": "1995-02-01 00:15:00",
"all_day": 1,
"Starts_on": "1995-02-01 00:00:00",
"Event_type": "Public",
"Subject": "Birthday: lalalalala"
}
]
}
Now when I try to bring the event which starts on 2014-07-17 12:00:00 (i.e, the first one in the response above).
Here's my request :
http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Starts_on%22,%22=%22,%222014-07-17%2012:00:00%22]]
But there's no response : {"data":[]}
However, when I try the same kind of filter request, but filter by subject instead of starts_on , it works perfectly fine, like this :
Request : http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Subject%22,%22=%22,%22fgsdfgvdgfdgfdgf%22]]
Response :
{"data":[{"Ends_on":null,"all_day":1,"Starts_on":"2014-07-17 12:00:00","Event_type":"Private","Subject":"fgsdfgvdgfdgfdgf"}]}
Any idea why this comparing the date is failing? and how i can solve it ?
P.S : I have tried all of the requests with my Google Chrome browsers.