An open API service indexing awesome lists of open source software.

https://github.com/ysdexlic/ng-age

an Angular filter to dynamically display a person's age based on their birthday
https://github.com/ysdexlic/ng-age

angular angular-component angular1-x bower bower-package package

Last synced: 6 months ago
JSON representation

an Angular filter to dynamically display a person's age based on their birthday

Awesome Lists containing this project

README

          

ng-age
---------
A filter for Angularjs to dynamically display a person's age based on their birthday

Check out the [Demo](http://thebeardydeveloper.com/ng-age).

Install
-------

$ bower install ng-age

Dependencies
------------
Just [AngularJS](https://github.com/angular/angular.js).

## How to use ng-age

### Include the file in your index.html:
``` html

```

### Inject the `ng-age` filter into your app module:

```javascript
angular.module('myApp', ['ng-age']);
```

### When outputting your age, apply the filter to your birthday:
``` html

{{ 'dd/mm/yyyy' | age }}


or

{{ 'dd/mm/yy' | age }}


```

You are also able to input a single digit for both day and month.

With years you will have to enter two digits at least. Any year from '00' - '09' will be considered as '2000' - '2009', however, any other two digit year will be considered as in the 1900s, e.g. entering '05/11/82' will be taken as the fifth of november 1982.