-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from stefanpenner/moment-helper-global-locale-tz
moment helper should use the service's locale and timeZone
- Loading branch information
Showing
4 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import Ember from 'ember'; | ||
import moment from 'moment'; | ||
import BaseHelper from './-base'; | ||
|
||
export default Ember.Helper.extend({ | ||
compute(params) { | ||
return moment(...params); | ||
export default BaseHelper.extend({ | ||
compute(params, { locale, timeZone }) { | ||
this._super(...arguments); | ||
|
||
return this.morphMoment(moment(...params), { locale, timeZone }); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,8 @@ | |
"dependencies": { | ||
"ember": "~2.8.0", | ||
"ember-cli-shims": "0.1.1" | ||
}, | ||
"resolutions": { | ||
"ember": "~2.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters