app.controller('remaingCtrl', ['$scope','$timeout', function($scope,$timeout){
$scope.dateCreated = new Date()
$scope.end = new Date("November 20, 2016 22:00:00");
$scope.dateStart = $scope.dateCreated.getTime()
$scope.dateEnd = $scope.end.getTime()
// как рассчитать сколько времени осталось до завершения?
}])
totalsec = Math.floor(Math.abs($scope.end - $scope.dateCreated)/1000);
secs = totalsec%60;
mins = Math.floor(totalsec/60)%60;
hours = Math.floor(totalsec/3600)%24;
days = Math.floor(totalsec/86400);
$scope.dateCreated = new moment();
$scope.end = new moment("20.11.2016 22:00:00", "DD-MM-YYYY HH:mm:ss");
$scope.diff = $scope.end.diff( $scope.dateCreated );