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

Commit

Permalink
chore(*): release 0.9.0, update moment to 2.9.0, removed deprecated m…
Browse files Browse the repository at this point in the history
…ethods
  • Loading branch information
urish committed Jan 11, 2015
1 parent 603410e commit bf7da2a
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 47 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.9.0 - 2015-01-11
- Support moment.js v2.9.0. See [here](https://gist.github.com/ichernev/0c9a9b49951111a27ce7) for changelog.
- Removed support for older moment.js versions. Only 2.8.0 and newer versions are now supported.
- Removed deprecated method: `amMoment.changeLanguage()`. Use `amMoment.changeLocale() instead.
- Removed deprecated event: `amMoment:languageChange`. Listen for `amMoment:localeChange` instead.
- Filters are now stateful by default (fixes [#97](https://github.com/urish/angular-moment/issues/97)).
- The project is now available on [NuGet](https://www.nuget.org/packages/angular-moment/) ([#99](https://github.com/urish/angular-moment/pull/99), contributed by [markvp](https://github.com/markvp)).

## 0.8.3 - 2014-12-08
- `amTimeAgo` filter ([#96](https://github.com/urish/angular-moment/pull/96), contributed by [maxklenk](https://github.com/maxklenk))
- Show formatted time as element title ([#78](https://github.com/urish/angular-moment/pull/78), contributed by [ctesene](https://github.com/ctesene))
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* License: MIT.
* Copyright (C) 2013, 2014, Uri Shaked.
* Copyright (C) 2013, 2014, 2015, Uri Shaked.
*/

'use strict';
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
angular-moment
==============

Angular.JS directive and filters for [Moment.JS](http://www.momentjs.com).
AngularJS directive and filters for [Moment.JS](http://www.momentjs.com).

Copyright (C) 2013, 2014, Uri Shaked <uri@urish.org>
Copyright (C) 2013, 2014, 2015, Uri Shaked <uri@urish.org>

[![Build Status](https://travis-ci.org/urish/angular-moment.png?branch=master)](https://travis-ci.org/urish/angular-moment)
[![Coverage Status](https://coveralls.io/repos/urish/angular-moment/badge.png)](https://coveralls.io/r/urish/angular-moment)
Expand All @@ -15,7 +15,7 @@ You can choose your preferred method of installation:
* Through bower: `bower install angular-moment --save`
* Through npm: `npm install angular-moment --save`
* Through NuGet: `Install-Package angular-moment`
* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/angular.moment/0.8.3/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.8.3/angular-moment.min.js)
* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/angular.moment/0.9.0/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.9.0/angular-moment.min.js)
* Download from github: [angular-moment.min.js](https://raw.github.com/urish/angular-moment/master/angular-moment.min.js)

Usage
Expand Down
24 changes: 3 additions & 21 deletions angular-moment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* angular-moment.js / v0.8.3 / (c) 2013, 2014 Uri Shaked / MIT Licence */
/* angular-moment.js / v0.9.0 / (c) 2013, 2014, 2015 Uri Shaked / MIT Licence */

'format global';
/* global define */
Expand Down Expand Up @@ -272,7 +272,6 @@
* @module angularMoment
*/
.service('amMoment', ['moment', '$rootScope', '$log', 'angularMomentConfig', function (moment, $rootScope, $log, angularMomentConfig) {
var that = this;
/**
* @ngdoc property
* @name angularMoment:amMoment#preprocessors
Expand All @@ -296,34 +295,17 @@
* Changes the locale for moment.js and updates all the am-time-ago directive instances
* with the new locale. Also broadcasts a `amMoment:localeChanged` event on $rootScope.
*
* @param {string} locale 2-letter language code (e.g. en, es, ru, etc.)
* @param {string} locale Locale code (e.g. en, es, ru, pt-br, etc.)
*/
this.changeLocale = function (locale) {
var result = (moment.locale || moment.lang)(locale);
var result = moment.locale(locale);
if (angular.isDefined(locale)) {
$rootScope.$broadcast('amMoment:localeChanged');

// The following event is deprecated and will be removed in an upcoming
// major release.
$rootScope.$broadcast('amMoment:languageChange');
}
return result;
};

/**
* @ngdoc function
* @name angularMoment.service.amMoment#changeLanguage
* @methodOf angularMoment.service.amMoment
* @deprecated Please use changeLocale() instead.
*
* @description
* Deprecated. Please use changeLocale() instead.
*/
this.changeLanguage = function (lang) {
$log.warn('angular-moment: Usage of amMoment.changeLanguage() is deprecated. Please use changeLocale()');
return that.changeLocale(lang);
};

/**
* @ngdoc function
* @name angularMoment.service.amMoment#preprocessDate
Expand Down
2 changes: 1 addition & 1 deletion angular-moment.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf7da2a

Please sign in to comment.