Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-moment

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-moment - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

angular-moment.min.js.map

4

angular-moment.js

@@ -1,2 +0,2 @@

/* angular-moment.js / v0.8.0 / (c) 2013, 2014 Uri Shaked / MIT Licence */
/* angular-moment.js / v0.8.1 / (c) 2013, 2014 Uri Shaked / MIT Licence */

@@ -152,3 +152,3 @@ /* global define */

var howOld = getNow().diff(momentInstance, 'minute');
var howOld = Math.abs(getNow().diff(momentInstance, 'minute'));
var secondsUntilUpdate = 3600;

@@ -155,0 +155,0 @@ if (howOld < 1) {

@@ -1,2 +0,2 @@

!function(){"use strict";function a(a,b){return a.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null}).constant("moment",b).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(b,c,d,e,f){return function(g,h,i){function j(){var a;if(e.serverTime){var b=(new Date).getTime(),d=b-t+e.serverTime;a=c(d)}else a=c();return a}function k(){q&&(b.clearTimeout(q),q=null)}function l(a){if(h.text(a.from(j(),s)),!w){var c=j().diff(a,"minute"),d=3600;1>c?d=1:60>c?d=30:180>c&&(d=300),q=b.setTimeout(function(){l(a)},1e3*d)}}function m(a){x&&h.attr("datetime",a)}function n(){if(k(),o){var a=d.preprocessDate(o,u,r);l(a),m(a.toISOString())}}var o,p,q=null,r=f.format,s=e.withoutSuffix,t=(new Date).getTime(),u=f.preprocess,v=i.amTimeAgo.replace(/^::/,""),w=0===i.amTimeAgo.indexOf("::"),x="TIME"===h[0].nodeName.toUpperCase();p=g.$watch(v,function(a){return"undefined"==typeof a||null===a||""===a?(k(),void(o&&(h.text(""),m(""),o=null))):(o=a,n(),void(void 0!==a&&w&&p()))}),a.isDefined(i.amWithoutSuffix)&&g.$watch(i.amWithoutSuffix,function(a){"boolean"==typeof a?(s=a,n()):s=e.withoutSuffix}),i.$observe("amFormat",function(a){"undefined"!=typeof a&&(r=a,n())}),i.$observe("amPreprocess",function(a){u=a,n()}),g.$on("$destroy",function(){k()}),g.$on("amMoment:languageChange",function(){n()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(b,c,d,e){this.preprocessors={utc:b.utc,unix:b.unix},this.changeLanguage=function(d){var e=b.lang(d);return a.isDefined(d)&&c.$broadcast("amMoment:languageChange"),e},this.preprocessDate=function(c,f,g){return a.isUndefined(f)&&(f=e.preprocess),this.preprocessors[f]?this.preprocessors[f](c,g):(f&&d.warn("angular-moment: Ignoring unsupported value for preprocess: "+f),!isNaN(parseFloat(c))&&isFinite(c)?b(parseInt(c,10)):b(c,g))},this.applyTimezone=function(a){var b=e.timezone;return a&&b&&(a.tz?a=a.tz(b):d.warn("angular-moment: timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?")),a}}]).filter("amCalendar",["moment","amMoment",function(a,b){return function(c,d){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,d);var e=a(c);return e.isValid()?b.applyTimezone(e).calendar():""}}]).filter("amDateFormat",["moment","amMoment",function(a,b){return function(c,d,e){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,e);var f=a(c);return f.isValid()?b.applyTimezone(f).format(d):""}}]).filter("amDurationFormat",["moment",function(a){return function(b,c,d){return"undefined"==typeof b||null===b?"":a.duration(b,c).humanize(d)}}])}"function"==typeof define&&define.amd?define("angular-moment",["angular","moment"],a):a(angular,window.moment)}();
//# sourceMappingURL=angular-moment.min.map
!function(){"use strict";function a(a,b){return a.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null}).constant("moment",b).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(b,c,d,e,f){return function(g,h,i){function j(){var a;if(e.serverTime){var b=(new Date).getTime(),d=b-t+e.serverTime;a=c(d)}else a=c();return a}function k(){q&&(b.clearTimeout(q),q=null)}function l(a){if(h.text(a.from(j(),s)),!w){var c=Math.abs(j().diff(a,"minute")),d=3600;1>c?d=1:60>c?d=30:180>c&&(d=300),q=b.setTimeout(function(){l(a)},1e3*d)}}function m(a){x&&h.attr("datetime",a)}function n(){if(k(),o){var a=d.preprocessDate(o,u,r);l(a),m(a.toISOString())}}var o,p,q=null,r=f.format,s=e.withoutSuffix,t=(new Date).getTime(),u=f.preprocess,v=i.amTimeAgo.replace(/^::/,""),w=0===i.amTimeAgo.indexOf("::"),x="TIME"===h[0].nodeName.toUpperCase();p=g.$watch(v,function(a){return"undefined"==typeof a||null===a||""===a?(k(),void(o&&(h.text(""),m(""),o=null))):(o=a,n(),void(void 0!==a&&w&&p()))}),a.isDefined(i.amWithoutSuffix)&&g.$watch(i.amWithoutSuffix,function(a){"boolean"==typeof a?(s=a,n()):s=e.withoutSuffix}),i.$observe("amFormat",function(a){"undefined"!=typeof a&&(r=a,n())}),i.$observe("amPreprocess",function(a){u=a,n()}),g.$on("$destroy",function(){k()}),g.$on("amMoment:languageChange",function(){n()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(b,c,d,e){this.preprocessors={utc:b.utc,unix:b.unix},this.changeLanguage=function(d){var e=b.lang(d);return a.isDefined(d)&&c.$broadcast("amMoment:languageChange"),e},this.preprocessDate=function(c,f,g){return a.isUndefined(f)&&(f=e.preprocess),this.preprocessors[f]?this.preprocessors[f](c,g):(f&&d.warn("angular-moment: Ignoring unsupported value for preprocess: "+f),!isNaN(parseFloat(c))&&isFinite(c)?b(parseInt(c,10)):b(c,g))},this.applyTimezone=function(a){var b=e.timezone;return a&&b&&(a.tz?a=a.tz(b):d.warn("angular-moment: timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?")),a}}]).filter("amCalendar",["moment","amMoment",function(a,b){return function(c,d){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,d);var e=a(c);return e.isValid()?b.applyTimezone(e).calendar():""}}]).filter("amDateFormat",["moment","amMoment",function(a,b){return function(c,d,e){if("undefined"==typeof c||null===c)return"";c=b.preprocessDate(c,e);var f=a(c);return f.isValid()?b.applyTimezone(f).format(d):""}}]).filter("amDurationFormat",["moment",function(a){return function(b,c,d){return"undefined"==typeof b||null===b?"":a.duration(b,c).humanize(d)}}])}"function"==typeof define&&define.amd?define("angular-moment",["angular","moment"],a):a(angular,window.moment)}();
//# sourceMappingURL=angular-moment.min.js.map
{
"name": "angular-moment",
"version": "0.8.0",
"version": "0.8.1",
"description": "Moment.JS directives & filters for Angular.JS (timeago alternative)",

@@ -13,7 +13,7 @@ "author": "Uri Shaked",

"angular": ">=1.0.0 <1.4.0",
"moment": ">=2.0.0 <2.8.0"
"moment": ">=2.0.0 <2.9.0"
},
"devDependencies": {
"angular-mocks": "1.2.x",
"moment-timezone": "0.1.0"
"moment-timezone": "0.2.1"
},

@@ -20,0 +20,0 @@ "repository": {

# Changelog
## 0.8.1 - 2014-09-01
- Support moment.js v2.8.0. See [here](https://gist.github.com/ichernev/ac3899324a5fa6c8c9b4) for changelog.
- Support moment-timezone v0.2.1. See [here](https://github.com/moment/moment-timezone/blob/develop/changelog.md#021-2014-08-02) for changelog.
- Bugfix: `updateTime()` is called too often for future dates ([#73](https://github.com/urish/angular-moment/issues/73))
## 0.8.0 - 2014-07-26

@@ -4,0 +9,0 @@ - Generate source map for the minified version ([#50](https://github.com/urish/angular-moment/issues/50))

@@ -18,3 +18,3 @@ /* License: MIT.

'bower_components/moment/moment.js',
'bower_components/moment/lang/fr.js',
'bower_components/moment/locale/fr.js',
'bower_components/moment-timezone/moment-timezone.js',

@@ -21,0 +21,0 @@ 'angular-moment.js',

{
"name": "angular-moment",
"version": "0.8.0",
"version": "0.8.1",
"main": "angular-moment.js",

@@ -10,8 +10,8 @@ "repository": {

"dependencies": {
"moment": ">=2.0.0 <2.8.0"
"moment": ">=2.0.0 <2.9.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"load-grunt-tasks": "0.4.0",
"grunt-contrib-uglify": "~0.4.0",
"load-grunt-tasks": "0.6.0",
"grunt-contrib-uglify": "0.5.1",
"grunt-contrib-jshint": "~0.10.0",

@@ -23,3 +23,3 @@ "grunt-karma": "~0.8.2",

"karma-phantomjs-launcher": "~0.1.1",
"coveralls": "~2.10.0",
"coveralls": "~2.11.0",
"grunt-ngdocs": "^0.2.1"

@@ -26,0 +26,0 @@ },

@@ -17,3 +17,3 @@ angular-moment

* Through npm: `npm install angular-moment --save`
* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/angular.moment/0.7.1/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.7.1/angular-moment.min.js)
* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/angular.moment/0.8.0/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.8.0/angular-moment.min.js)
* Download from github: [angular-moment.min.js](https://raw.github.com/urish/angular-moment/master/angular-moment.min.js)

@@ -20,0 +20,0 @@

@@ -5,3 +5,3 @@ /* License: MIT.

/* global describe, inject, module, beforeEach, afterEach, it, expect, spyOn */
/* global describe, inject, module, beforeEach, afterEach, it, expect, spyOn, jasmine */

@@ -38,2 +38,3 @@ 'use strict';

angular.copy(originalAngularMomentConfig, angularMomentConfig);
jasmine.clock().uninstall();
});

@@ -124,2 +125,12 @@

it('should schedule the update timer to one hour ahead for date in the far future (#73)', function () {
$rootScope.testDate = new Date(new Date().getTime() + 86400000);
jasmine.clock().install();
spyOn($window, 'setTimeout');
var element = angular.element('<div am-time-ago="testDate"></div>');
element = $compile(element)($rootScope);
$rootScope.$digest();
expect($window.setTimeout).toHaveBeenCalledWith(jasmine.any(Function), 3600000);
});
describe('bindonce', function () {

@@ -126,0 +137,0 @@ it('should change the text of the div to "3 minutes ago" when given a date 3 minutes ago with one time binding', function () {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc