Grid type: date - unable to get format correctly


I have a date column that i had noticed would not sort correctly because it was by default a string. However I tried to use the format feature and it works for the day and year but changes the month all to first month

date format/output should be for example: 03/23/2020

The following:

columns: [ { width: 150, id: "my_id", header: [{ text: "Date" },{ content: "inputFilter" }],type: "date", format: "%m/%d/%Y" } ]

outputs: 01/23/2020

the day and year is good but i cannot figure out what i missing for the month

also, i presume format is necessary as i’ve tried just type: “date” w/ no luck

Please advise - thanks!


I am using your code and I’m finding a problem with the ‘/’ formatting. Are you sure this is working on your end? Here is a snippet using your code. If you place the ‘/’ (forward-slash) between the date codes, the script fails.


Hey ND,

Thanks for the try…my date format is: “Month/Day/Year”…your code is not prepared for that data and probably is why it’s getting the error…

I did find the issue…below are 2 sets of data …

  1. dataset has date where can be single digit day or month and that is what’s making it not work with the format “%m/%/d%Y”

  2. dataset_02 does work with the format “%m/%/d%Y”

So I can manipulate the date on the backend before processed by javascript or is there a format that will work with a date that can have a single digit day or month?



    const dataset = 

    const dataset_02 = 

const grid = new dhx.Grid("grid", {
    columns: [ 
              { width: 150, id: "first_discovered", header: [{ text: "First Discovered" }, { content: "inputFilter" }],type: "date", format: "%m/%d/%Y" },
              { width: 150, id: "last_discovered",  header: [{ text: "Last Discovered" },{ content: "inputFilter" }],type: "date", format: "%m/%d/%Y" }                

    data: dataset_02



If a month is defined without a leading zero it should be defined as “%n” in your date format:
The template can be found here:
Please, try to use the date format corresponding to the used one in your data