diff options
Diffstat (limited to 'js/app/services')
-rw-r--r-- | js/app/services/language.coffee | 8 | ||||
-rw-r--r-- | js/app/services/moment.coffee | 0 | ||||
-rw-r--r-- | js/app/services/services.coffee | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/js/app/services/language.coffee b/js/app/services/language.coffee index 85a405fc7..ac46b0bc4 100644 --- a/js/app/services/language.coffee +++ b/js/app/services/language.coffee @@ -27,11 +27,17 @@ angular.module('News').factory 'Language', -> constructor: -> @_language = 'en' + handle: (data) -> - @_language = data.language + @_language = data.split('_')[0] + getLanguage: -> return @_language + getMomentFromTimestamp: (timestamp) -> + return moment.unix(timestamp).lang(@_language) + + return new Language() diff --git a/js/app/services/moment.coffee b/js/app/services/moment.coffee new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/app/services/moment.coffee diff --git a/js/app/services/services.coffee b/js/app/services/services.coffee index 19e4b990d..d67e1d2c5 100644 --- a/js/app/services/services.coffee +++ b/js/app/services/services.coffee @@ -99,4 +99,3 @@ FolderModel, FeedModel, Language) -> return publisher ] - |