Sort.js
550 Bytes
define(function(require) {
'use strict';
var Sort = {
standard: function standardSort(a, b) {
if (a < b) {
return -1;
} else if (a > b) {
return 1;
} else {
return 0;
}
},
date: function dateSort(a, b) {
return Sort.standard.call(this, a, b);
},
number: function numberSort(a, b) {
return Sort.standard.call(this, parseInt(a), parseInt(b));
},
};
return Sort;
});