angular-isDate-2

 

In this example of angular.isDate it will return false because date is in string format.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome in the AngularJS</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="app"> <div ng-controller="isDateController"> isDate: {{isDate}} ({{date}}) </div> </body> </html> <script> var app = angular.module("app", []); app.controller('isDateController', ['$scope', function ($scope) { $scope.date = (new Date).toLocaleDateString(); $scope.isDate = angular.isDate($scope.date) }]); </script>
Output