From: Dobrica Pavlinusic Date: Fri, 18 Jan 2013 12:51:04 +0000 (+0100) Subject: don't try to split empty value X-Git-Tag: 0.6~18 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=refs%2Fheads%2Fdrzb2013v2;hp=494e80b13ba9602af1c51c8508c2b1496ca8ef99;p=angular-drzb don't try to split empty value --- diff --git a/app/js/filters.js b/app/js/filters.js index ae88186..1b331b0 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -10,6 +10,7 @@ angular.module('myApp.filters', []). }]). filter('registration_date_time', function() { return function(text) { + 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/, '');