$.fn.dataTable.moment is not a function error

$.fn.dataTable.moment is not a function error

KashyapShivaniKashyapShivani Posts: 15Questions: 3Answers: 0
edited September 2019 in Free community support


All js are added which need to use this, still its gives error
I also maintain the sequence of js file

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    Hi @KashyapShivani ,

    Have you also included the Moment.js source too?

    Cheers,

    Colin

  • KashyapShivaniKashyapShivani Posts: 15Questions: 3Answers: 0

    yes,I include moment.min.js and dateTime-moment.js

  • kthorngrenkthorngren Posts: 21,182Questions: 26Answers: 4,925
    Answer ✓

    Maybe you are loading the JS in the wrong order or there is a problem loading one of them. Its hard to say without seeing your page. Can you post a link to your page or a test case replicating the issue?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • KashyapShivaniKashyapShivani Posts: 15Questions: 3Answers: 0
    edited September 2019

    This is order of add js file where newMoment is moment.min.js and jqdataTablesSortDate is jquery.dataTables.js

    define(['durandal/app', 'durandal/events', 'jqueryUiLayout','visileanUtil','knockout', 'dateUtils', 'statusUtils', 'activityUtils', 'messageUtils','dataTableButtons','dataTableBootstrap','newDateRange','jqdataTablesSortDate','newMoment','dateTimeMoment'], function(app, events, $, visileanUtil, ko, dateUtils, statusUtils, activityUtils, messageUtils, dataTableButtons, dataTableBootstrap, newDateRange,jqdataTablesSortDate,newMoment,dateTimeMoment) {
        var delayedTaskDetailPage = function() {
    
     also add sorting line ----
    
      var columnData;
            //Jquery dataTable method..................
              var rowIndex = null;
    
              $.fn.dataTable.moment( 'MM/DD/YYYY' );
    
              self.dataTable = function() {
                 delayedDT = $('#delayedTaskList').DataTable({
    

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    You'll need to load Moment.js before DataTables. If no joy, please link to a test case.

  • KashyapShivaniKashyapShivani Posts: 15Questions: 3Answers: 0

    I also do that still its doesn't work fine,give same error

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You have been asked - twice - to provide a test case.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

  • xmediasoftwarexmediasoftware Posts: 1Questions: 0Answers: 0

    You must to add this plugin script

    //cdn.datatables.net/plug-ins/1.10.25/dataRender/ellipsis.js

    Full Documentation: https://datatables.net/plug-ins/dataRender/ellipsis

Sign In or Register to comment.