Skip to content

Commit

Permalink
Update datetime-moment plugin. Add a Boolean parameter that allows to…
Browse files Browse the repository at this point in the history
… invert the order of empty values.
  • Loading branch information
AlexDEVpro committed Mar 16, 2019
1 parent 4375d45 commit 90dcdf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sorting/datetime-moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
}(function ($, moment) {

$.fn.dataTable.moment = function ( format, locale ) {
$.fn.dataTable.moment = function ( format, reverseEmpties, locale ) {
var types = $.fn.dataTable.ext.type;

// Add type detection
Expand Down Expand Up @@ -66,7 +66,7 @@ $.fn.dataTable.moment = function ( format, locale ) {
}

return !moment(d, format, locale, true).isValid() ?
Infinity :
(reverseEmpties ? -Infinity : Infinity) :
parseInt( moment( d, format, locale, true ).format( 'x' ), 10 );
};
};
Expand Down

0 comments on commit 90dcdf2

Please sign in to comment.