Invalid date in firefox

Answered
Subramanian asked on July 14, 2023

Hi, 
I'm facing an issue with displaying dates in Firefox, the same dates do appear properly in Chrome.
I have attached screenshots of how it looks now in Firefox and Chrome. My column object looks like this:

deliver_date:{
caption: "Deliver Date",
color:{},
format:"DD-MM-YYYY HH:MM:ss",
type:"datetime"

Let me know if I should provide any other info to solve this issue.

4 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster July 17, 2023

Hello,

Thank you for reaching out to us and providing the screenshots.

Our team tried to reproduce the issue by using Firefox Browser. All the dates are displayed as expected.
We suppose that the issue is caused by the deliver_date data format that you pass to Flexmonster. Kindly note that Flexmonster supports the following input date formats:

  1. ISO 8601. For example:
    • "2021-04-25" – Date.
    • "2021-04-25T21:30:05" – Date and time.
    • "2021-04-25T21:30:05+03:00" – Date and time with a time zone.
  2. Unix timestamp in milliseconds. For example, "2021-04-25" is 1619298000000 when converted to a Unix timestamp in milliseconds.

Could you please check if you are passing the correct format of the deliver_date to Flexmonster?

Looking forward to hearing from you.

Kind regards,
Nadia

Public
Subramanian July 19, 2023
07-05-2019 00:00:00

Is there anyway to format this data before the customize cell is called? I know

07-05-2019T00:00:00

will work but I want to know if there is similar function to customizeCell that can get the raw date value, that I can format before customizeCell is called?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster July 19, 2023

Hello,

Thank you for reaching out to us.

Please note that 07-05-2019 00:00:00 and 07-05-2019T00:00:00 are not the correct formats to pass to Flexmonster. It should be in the yyyy-MM-dd'T'HH:mm:ss format or in the Unix timestamp(in milliseconds) in your data source. For example, your date should be passed to Flexmonster in the following way:

2019-05-07T00:00:00

To define how the date will be shown on the grid, you can use the format property of the mapping. 
If you want to see the date on the grid in the format "DD-MM-YYYY", you can set the mapping like this:

mapping: {
     "Date": {
          type: "datetime",
          format: "DD-MM-YYYY"
      }
}

You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/edghr49b/ 
Note: The input format of the date should only be ISO 8601 or Unix timestamp. This way, the dates will be displayed in all the browsers.

Please let us know if you have further questions.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 1, 2023

Hello,

Hope you are doing well.

We were wondering if you had a chance to test a suggested approach.

Looking forward to hearing your feedback.

Kind regards,
Nadia

Please login or Register to Submit Answer