Author Topic: Date filter not working when From and To date are selected as same date  (Read 2581 times)

applepqgrid

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 26
    • View Profile
Hi,

We have implemented  the date picker as per the demo https://paramquery.com/pro/demos/filter_header_local  (look for orderdate feild). Below is the “json” used in the demo.

 Note:  Using the below JSON, I am able to see the correct search results while searching with same From and To Date (OrderDate field search in demo).
{
   "data": [{
      "OrderID": 10409,
      "ContactName": "Yvonne Moncada",
      "EmployeeID": 3,
      "OrderDate": "01/09/1997",
      "RequiredDate": "02/06/1997",
      "ShippedDate": "01/14/1997",
      "ShipVia": "Speedy Express",
      "Freight": 29.83,
      "ShipName": "Océano Atlántico Ltda.",
      "ShipAddress": "Ing. Gustavo Moncada 8585 Piso 20-A",
      "ShipCity": "Buenos Aires",
      "ShipRegion": null,
      "ShipPostalCode": "1010",
      "ShipCountry": "Argentina",
      "paid": true,
      "code": "ar"
   }, {
      "OrderID": 10531,
      "ContactName": "Yvonne Moncada",
      "EmployeeID": 7,
      "OrderDate": "05/08/1997",
      "RequiredDate": "06/05/1997",
      "ShippedDate": "05/19/1997",
      "ShipVia": "Speedy Express",
      "Freight": 8.12,
      "ShipName": "Océano Atlántico Ltda.",
      "ShipAddress": "Ing. Gustavo Moncada 8585 Piso 20-A",
      "ShipCity": "Buenos Aires",
      "ShipRegion": null,
      "ShipPostalCode": "1010",
      "ShipCountry": "Argentina",
      "paid": true,
      "code": "ar"
   }   ]
}



But in our case, it's date time field with format like AUG 14, 2018 05:59:17 AM. Now if I choose same value for 'From' and 'To' dates (eg : Aug 14, 2018), then it's showing 'No rows to display'.

In general, we are facing following issues:

1) Same date search is not working
2) Search result doesn't include same To date records .


Can you please suggest solution for this?








« Last Edit: August 15, 2018, 12:52:24 pm by applepqgrid »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Date filter not working when From and To date are selected as same date
« Reply #1 on: August 15, 2018, 10:43:23 pm »
Raw json data in date fields is supported only in mm/dd/yy and yy-mm-dd format, although they can be displayed in any format supported by jQueryUI datepicker.

https://paramquery.com/pro/api#option-column-dataType

You might need to remove the time and format the dates in json data as mm/dd/yy or yy-mm-dd