JSFiddle - React, Tailwind, and code Playground

by Graham Fairweather

JavaScript

var data = [],
    sortThis,
    i;

for (i = 0; i < 10; i += 1) {
    data[i] = [];
    data[i][0] = new Date(2013, 08, 30 - i).getTime() / 1000; // Unix-Date
    data[i][1] = i * 100; // Example for Money
    data[i][2] = "text1 " + i; // Example for Text
    data[i][3] = "text2 " + i; // Example for Text
    data[i][4] = "text3 " + i; // Example for Text
}

sortThis = data.slice();
sortThis.sort(function (a, b) {
    if (a[0] === b[0]) {
        return 0;
    }

    if (a[0] < b[0]) {
        return -1;
    }

    return 1;
});

console.log(data, sortThis);