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
- Host: GitHub
- URL: https://github.com/ysdexlic/ng-age
- Owner: ysdexlic
- Created: 2016-10-01T11:39:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-05T14:51:31.000Z (over 7 years ago)
- Last Synced: 2025-02-16T04:08:59.276Z (about 1 year ago)
- Topics: angular, angular-component, angular1-x, bower, bower-package, package
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.