paviro / MMM-FRITZ-Box-Callmonitor

This an extension for the MagicMirror. It provides a callmonitor for FRITZ!Box users alerting them about incoming calls.
28 stars 22 forks source link

Sorting is not working #29

Open commaender opened 6 years ago

commaender commented 6 years ago

On my system the call history is sorted in a wrong order! It is completely out of order, call from yesterday, today, 3 days ago, yesterday, and so on.

Setup: FritzBox 7390 with current firmware, German language...

I changed the sortHistory function, now it works for me:

sortHistory: function() {
    var history = this.callHistory;

    //Sort history by time
    history.sort(function(a, b) {
        return new Date(b.time) - new Date(a.time);
    });

    this.callHistory = history;
},
PieBa commented 4 years ago

I had the same issue. This fix worked for me. Thanks!

What about a Pull Request?