Closed ericnh closed 5 years ago
I wanted to try it, so I went to moment page: https://momentjs.com/ and tried your example in console there
moment('N/A', "MM/DD/YY hh:mma UTCZZ (zz)").format("YYYY/MM/DD/HH/mm/ss")
result is "Invalid date"
so the solution might be updating moment.js is it possible in your environment to put newest moment.js there ant check if it works better?
I have a datetime sortable column displayed in this format: 02/01/17 12:44pm UTC-0800 (PST)
Which is defined in the data-dateformat attribute as: "MM/DD/YY hh:mma UTCZZ (zz)"
That works great. The problem is that not every cell has an available date. When the attribute is missing from the row the string 'N/A' is printed out into that cell instead. This seems to be interpreted by moment to somehow mean today:
This creates a problem with sorting because the 'N/A' rows get placed between rows with a date greater than or equal to the current date and dates less than the current date.
I tried to manually set the data-value for these rows with an arbitrarily early date
data-value="0001/01/01/00/00/00"
. But this seems to get overwritten. When I look at the dom the data-value for these 'N/A' rows appears asdata-value="2017/02/01/00/00/00"
Any help would be appreciated. Thank you!