 
             .then (entries) ->
                 $rootScope.entries = []
+                console.log entries
                 # sort and flatten
-                desc = (a, b) -> Date.parse(b.date) - Date.parse(a.date)
                 entries
-                    .sort desc
-                    .forEach (obj)->
+                    .sort (a, b) ->
+                        date = (x) ->
+                            Date.parse x.date
+                        return date b - date a
+                    .forEach (obj) ->
                         obj.forEach (entry) ->
                             $rootScope.entries.push entry
 

        replace: true
        templateUrl: 'templates/language-switch.html'
        controller: [
            '$scope'
            '$rootScope'
            '$translate'
            ($scope, $rootScope, $translate) ->

                changeLanguage = (key) ->
                    $translate.use(key)
                    $rootScope.selectedLocale = key
                    $rootScope.entriesShim = $rootScope.entries.filter (entry) ->
                        entry.locale = key

                $rootScope.$on 'entriesLoaded', ->
                    $scope.key = $rootScope.selectedLocale

                                entry.date = new Date(rawDate).toLocaleDateString()
                                entry.time = new Date(rawDate).toLocaleTimeString()
                                entry.body = entry.body # need sanitization?
                        deferred.resolve entries
                        return deferred.promise

