Add a refresh date for datatable

Add a refresh date for datatable

yu yen kanyu yen kan Posts: 65Questions: 31Answers: 0

how can I add a date time label to datatable to show user last reload() date time

Answers

  • allanallan Posts: 63,889Questions: 1Answers: 10,530 Site admin

    The xhr event would be where to add the code that would be used to get the current date and then display it:

    table.on( 'xhr', function () {
      $('...').html( 'Last update: '+new Date() );
    } );
    

    You'll probably want to add date formatting as well of course.

    Allan

This discussion has been closed.