AngularJS | angular.isDate() Function
The angular.isDate() function in AngularJS is used to determine the value of date is valid or not. It returns true if the reference is a date else false.
Syntax:
angular.isDate( value )
Parameters: This function accepts single parameter value which stores the date object.
Return Value: It returns true if the value passed is date else return false.
Example: This example uses angular.isDate() function to determine the value of date is valid or not.
<!DOCTYPE html> <html> <head> <title>angular.isDate() function</title> <script src= "//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"> </script> </head> <body ng-app="app" style="text-align:center"> <h1 style="color:green">GeeksforGeeks</h1> <h2>angular.isDate()</h2> <div ng-controller="geek"> <b>Date:</b> {{ date }} <br><br> isDate: {{isDate}} </div> <!-- Script to uses angular.isDate() function --> <script> var app = angular.module("app", []); app.controller('geek', ['$scope', function ($scope) { $scope.date = new Date; $scope.isDate = angular.isDate($scope.date) }]); </script> </body> </html> |
Output:

Recommended Posts:
- AngularJS | angular.toJson() Function
- AngularJS | angular.element() Function
- AngularJS | angular.lowercase() Function
- AngularJS | angular.isFunction() Function
- AngularJS | angular.isElement() Function
- AngularJS | angular.uppercase() Function
- AngularJS | angular.forEach() Function
- AngularJS | angular.isObject() Function
- AngularJS | angular.isUndefined() Function
- AngularJS | angular.isNumber() Function
- AngularJS | angular.isString() Function
- AngularJS | angular.isDefined() Function
- AngularJS | angular.equals() Function
- AngularJS | angular.bind() Function
- AngularJS | angular.isArray() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



