I am trying the grid for the first time but having a problem with a date column. The data includes a date field in MM/DD/YYYY format so I set the format option to that, but I am getting an error “Uncaught error: incorrect date”. Here is my code defining the grid.
grid = new dhx.Grid("grid", {
columns: [
{ width: 100, id: "id_no", header: [{ text: "ID #" }] },
{ width: 250, id: "full_name", header: [{ text: "Name" }] },
{ width: 250, id: "company", header: [{ text: "Name" }] },
{ width: 120, id: "modify_date", type: 'date', format: '%m/%d/%Y', header: [{ text: "Date" }] }
]
});
grid.data.load("sql_main.php?proc=get_customers_test");
Here is a portion of the JSON data so you can see that the date is in the format expected.
[{"full_name":"1ST CHOICE MEDICAL GROUP","company":"LEA LAWSON, DC","id_no":"R03767","modify_date":"01/14/2023"},
{"full_name":"34TH STREET FOOT CARE","company":"DR. HERZLICH","id_no":"R00265","modify_date":"04/21/2023"},
{"full_name":"72ND STREET PODIATRY ASSOCIATES","company":"DR. STUART MOGUL","id_no":"R00377","modify_date":"01/14/2023"},
{"full_name":"A & A CHIROPRACTIC","company":"ALEXANDER L. ROWELL, DC","id_no":"R02634","modify_date":"07/30/2023"},
{"full_name":"A CALL AWAY FOOT CARE","company":"","id_no":"R01094","modify_date":"07/30/2023"},
{"full_name":"A JOINT VENTURE CHIROPRACTIC","company":"","id_no":"R02909","modify_date":"10/15/2022"}]
As the date appears to match the format I’ve indicated, I don’t understand where the error is coming from.