Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tabulator 5.0 - parsing datetime luxon - datetime ISO 8601

I currently try to parse datetime in tabulator js library. My datetime string is "2021-09-11T00:00:00.000Z".

On the last release, they change the datetime library to luxon. I didn't success to find the good format for that kind of date. In the documentation, it seems that they kept the last datetime library moment.js. I read the luxon documentation but i didn't succeed.

I tried :

{title:"Début Campagne", field:"start_date" ,formatter:"datetime", formatterParams:{ inputFormat:"yyyy-MM-ddTHH:mm:ss:SSSZ", outputFormat:"dd/MM/yyyy"}}

The way tabulator use luxon, i can't use the function Datetime.FromIso than can parse ISO 8601 so i have to found the correct format.

Thank you for your help

like image 639
Kareivis Avatar asked Sep 18 '25 13:09

Kareivis


1 Answers

As of Tabulator v5.1 there is now built in iso support for formatters

{title:"Example", field:"example", formatter:"datetime", formatterParams:{
    inputFormat:"iso",
}}

And sorters:

{title:"Example", field:"example", sorter:"datetime", sorterParams:{
    format:"iso",
}}
like image 154
Oli Folkerd Avatar answered Sep 20 '25 04:09

Oli Folkerd