improve date handling, date is now available in the global $scope