Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge 2eb0ac8 into 448e472
Browse files Browse the repository at this point in the history
  • Loading branch information
Jkim55 committed Oct 16, 2016
2 parents 448e472 + 2eb0ac8 commit 6bc4576
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Instructions for using moment-timezone with webpack

Even if you have `moment-timezone` in your `package.json`, `angular-moment` will not be able to use it unless you override
moment using Angular's dependency injection [See Resolved Issue](https://github.com/urish/angular-moment/pull/234)

```javascript
var angular = require('angular');
require('angular-moment');
var ngModule = angular.module('ngApp',['angularMoment']);
ngModule.constant('moment', require('moment-timezone'));
```


Usage
-----
Include both **moment.js** and **angular-moment.js** in your application.
Expand Down Expand Up @@ -71,7 +71,7 @@ myapp.run(function(amMoment) {

### Use in controller/service/factory
Inject the `moment`-constant into your dependency injection. For example:

```js
angular.module('fooApp')
.controller('FooCtrl', ['$scope', 'moment', function ($scope, moment) {
Expand All @@ -92,7 +92,7 @@ code:
```js
$scope.message = {
text: 'hello world!',
time: new Date()
time: new Date().getTime()
};
```

Expand Down Expand Up @@ -123,7 +123,7 @@ Note: To use `amFromUnix`, install angular-moment version 1.0.0-beta.3 or newer

### amUtc filter

Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
Create / switch the current moment object into UTC mode. For example, given a date object in `message.date`,
the following code will display the time in UTC instead of the local timezone:

```html
Expand All @@ -145,7 +145,7 @@ Note: To use `amUtcOffset`, install angular-moment version 1.0.0-beta.3 or newer

### amLocal filter

Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
Changes the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone`
for timezone conversion. For example, the following will convert the given UTC date to local time:

```html
Expand Down Expand Up @@ -207,7 +207,7 @@ For more information about Moment.JS difference function, see the
### amDurationFormat filter

Formats a duration (such as 5 days) in a human readable format. See [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/)
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
for a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/)
for explanation about the formatting algorithm.

Example:
Expand Down

0 comments on commit 6bc4576

Please sign in to comment.