Get Free Trial

Datetime formatting

Jimmy asked on May 26, 2021

I’m having some difficulties using “DateTime”, “Date string” and “Time”, hope you can help.
With formatting platter set to “yyyy-MM-ddThh:mm” to returns “2012-05-23P12:34”
Should return “2012-05-23T12:34”
Date string:
Returns “Invalid date” when no date is given.
Can this be changed to return blank like DateTime.
As there is no Timestamp object in JS I pass a date object to it “1899-12-30T12:25:33.123Z” this result I every Time cell saying “00:31:39” 

2 answers

Milena Pechura Milena Pechura Flexmonster May 27, 2021

Hello, Jimmy,
Thank you for your questions.
Please find our comments below.

  1. In the pattern you used, the letter T stands for AM/PM one-letter indicator, which shows the A or P letter on the grid.
    To achieve the desired behavior of the pattern, please enclose the T letter in quotation marks. The pattern should look like this: "yyyy-MM-dd'T'hh:mm"
    Please find further details about dateTimePattern here:!format-datetime.
  2. We would like to confirm that it is possible to change the "Invalid date" text. Please use the Flexmonster localization object:
    localization: {
    "grid": {
    "dateInvalidCaption": "(blank)"

    Here is an example for illustration:
    We also recommend browsing related docs:

  3. The unexpected result you see on the grid was caused by the time format in your dataset.
    Please kindly note that the time passed to Flexmonster should be specified in seconds. For example:
    "Time": 121

    Here is a link to the corresponding section of the "Date and time formatting" article:!input-time-format.

Please let us know if our answer helped.
Looking forward to hearing from you.
Best regards,

Jimmy May 28, 2021

Thanks for the answer, it helped.

Please login or Register to Submit Answer