 
             .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
 

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


ENDPOINT_BASE = "http://api.c4w.jp/api/v1/"
DEFAULT_LANG = 'ja'
FALLBACK_LANG = 'en'
LANGUAGE_LABELS =
    ja: '日本語'
    en: 'English'

getEndpoint = (key) -> "#{ENDPOINT_BASE}#{key}.json"

app = angular.module 'disaster-information-client', [
    'pascalprecht.translate'
