return any date to IE
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 20 Jan 2013 21:27:49 +0000 (22:27 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 20 Jan 2013 21:27:49 +0000 (22:27 +0100)
app/js/filters.js

index 1b331b0..84624ac 100644 (file)
@@ -13,6 +13,10 @@ angular.module('myApp.filters', []).
                if ( ! text ) return '?';
                var timestamp = parseInt( text.split(/\./)[1] );
         var date = new Date(timestamp / 100); // 100000 / 1000
-        return date.toISOString().replace(/T/, ' ').replace(/\.[0-9]{3}Z/, '');
+               if ( date.toISOString !== undefined ) {
+               return date.toISOString().replace(/T/, ' ').replace(/\.[0-9]{3}Z/, '');
+               } else {
+                       return date.toString();
+               }
     }
   });