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

moment-range

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment-range - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

12

lib/moment-range.js

@@ -43,3 +43,3 @@ // Generated by CoffeeScript 1.3.3

* for each sub-range.
* @param {!DateRange} range Date range to be used for iteration.
* @param {!DateRange|String} range Date range to be used for iteration or shorthand string (shorthands: http://momentjs.com/docs/#/manipulating/add/)
* @param {!function(Moment)} hollaback Function to execute for each sub-range.

@@ -52,4 +52,12 @@ * @return {!boolean}

DateRange.prototype.by = function(range, hollaback) {
var i, l, _i;
var end, i, l, start, _i;
if (typeof range === 'string') {
start = moment();
end = moment(start).add(range, 1);
range = moment().range(start, end);
}
l = Math.round(this / range);
if (l === Infinity) {
return this;
}
for (i = _i = 0; 0 <= l ? _i <= l : _i >= l; i = 0 <= l ? ++_i : --_i) {

@@ -56,0 +64,0 @@ hollaback.call(this, moment(this.start.valueOf() + range.valueOf() * i));

2

package.json

@@ -8,3 +8,3 @@ { "name": "moment-range"

, "directories": { "lib" : "./lib" }
, "version": "0.1.1"
, "version": "0.1.2"
, "engines":

@@ -11,0 +11,0 @@ { "node": "*"

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