Uncaught TypeError: $.fn.dataTable.moment is not a function

Uncaught TypeError: $.fn.dataTable.moment is not a function

Alex53Alex53 Posts: 13Questions: 4Answers: 0

Hi,

I try add datetime field to editor, but get error

Uncaught TypeError: $.fn.dataTable.moment is not a function

Import moment and datatables.net-datetime, but doesn't work.

Test app:

https://tinyurl.com/ym9r54s7

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin
    Answer ✓

    Replace that line with the one you commented out:

     DataTable.datetime('DD.MM.YYYY');
    

    The old $.fn.dataTable.moment is provided by this plug-in, but is now irrelevant since DataTables has something very similar built in.

    Allan

  • Alex53Alex53 Posts: 13Questions: 4Answers: 0

    Allan, thanks.
    I commented out this line. Error is gone, but Editor with datetime type doesn't work.
    See https://tinyurl.com/ym9r54s7

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    "orderable": false, "targets": [0,1,2,3,4,5] },

    You've got ordering disabled on the date column (index 4 if I've reading it correctly).

    Allan

  • Alex53Alex53 Posts: 13Questions: 4Answers: 0

    Allan, ordering work well, I have problem whit editor. Create new discussion.

Sign In or Register to comment.