diff --git a/sorting/datetime-moment.js b/sorting/datetime-moment.js index d886690..ce5c197 100644 --- a/sorting/datetime-moment.js +++ b/sorting/datetime-moment.js @@ -20,7 +20,13 @@ * $('#example').DataTable(); */ -(function($) { +(function (factory) { + if (typeof define === "function" && define.amd) { + define(["jquery", "moment", "datatables"], factory); + } else { + factory(jQuery, moment); + } +}(function ($, moment) { $.fn.dataTable.moment = function ( format, locale ) { var types = $.fn.dataTable.ext.type; @@ -50,4 +56,4 @@ $.fn.dataTable.moment = function ( format, locale ) { }; }; -}(jQuery)); +}));