var app = angular.module("app")
    .service("utilityService",function($mdToast) {

        var service =  {};

        /**
         * This function formats a timestamp and returns it into a simple date dd/mm/yyyy
         * @returns {*}
         */
        service.formatDate = function(dateString){
            var date = dateString.split("-").join("/")
                                 .replace( /\.[0-9+]+$/g, '' )
                                 .replace(/T/, ' ');
            var date_object = new Date(date);
            var month = date_object.getMonth() + 1;
            var day = date_object.getDate();
            var year = date_object.getFullYear();
            var date_object_formatted = day + "/" + month + "/" + year;

            return date_object_formatted;
        };

        /**
        * function parses a ISO 8601 date safetly since
        * IE and Safari cannot handle microseconds
        * @returns Date Object
        */
        service.parseDate = function(dateString){
            var date = dateString.split("-").join("/").replace( /\.[0-9+]+$/g, '' );
            return new Date(date);
        };

        service.showToast = function(text) {
            $mdToast.show(
                $mdToast.simple()
                    .content(text)
                    .hideDelay(4000)
                    .position('top right')
            );
        }

        service.showToastBottomRight = function(text) {
            $mdToast.show(
                $mdToast.simple()
                    .content(text)
                    .hideDelay(3000)
                    .position('bottom right')
            );
        }

        return service;
    });

@@ -286,32 +286,71 @@
 on(dateString)%7B%0A
+            if(!(dateString)) return;%0A%0A
             var 
@@ -1027,32 +1027,70 @@
 on(dateString)%7B%0A
+            if(!(dateString)) return;%0A
             var 
@@ -1136,35 +1136,31 @@
 replace(
- 
 /%5C
-.
++
 %5B0-9
-+
 %5D+$/g,
- 
 ''
- 
 );%0A     

make the utilityService.parseDate regex work across browsers ( again )