angular.validator.date

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Use date validator to restrict the user input to a valid date in format in format MM/DD/YYYY.

Usage

In HTML Template Binding

<input type="text" ng:validate="date"/>

In JavaScript

angular.validator.date(value)

Parameters

Example

  Enter valid date:
  <input name="text" value="1/1/2009" ng:validate="date" >
  it('should invalidate date', function(){
   var n1 = element('.doc-example-live :input');
   expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
   input('text').enter('123/123/123');
   expect(n1.attr('className')).toMatch(/ng-validation-error/);
  });