New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

moment-recur

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment-recur - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

bower.json
{
"name": "moment-recur",
"main": "moment-recur.js",
"version": "1.0.6",
"version": "1.0.7",
"homepage": "https://github.com/c-trimm/moment-recur",

@@ -6,0 +6,0 @@ "authors": [

@@ -0,0 +0,0 @@ var gulp = require('gulp');

@@ -0,0 +0,0 @@ // Karma configuration

@@ -714,20 +714,3 @@ (function (root, factory) {

moment.fn.monthWeekByDay = function(date) {
var day, week0, day0, diff;
// date obj
day = this.clone();
// First day of the first week of the month
week0 = this.clone().startOf("month").startOf("week");
// First day of week
day0 = this.clone().startOf("week");
diff = day0.diff(week0, "weeks");
if (day.subtract(diff, "weeks").month() === this.clone().month()) {
return diff;
}
return diff - 1;
return Math.floor((this.date()-1)/7);
};

@@ -734,0 +717,0 @@

{
"name": "moment-recur",
"version": "1.0.6",
"version": "1.0.7",
"description": "A momentjs plugin for matching and generating recurring dates.",

@@ -17,2 +17,5 @@ "main": "moment-recur.js",

"license": "Unlicense",
"dependencies": {
"moment": "<3.0.0"
},
"devDependencies": {

@@ -28,6 +31,4 @@ "gulp": "~3.8.10",

"scripts": {
"test": "gulp test",
"preinstall": "npm install bower gulp",
"postinstall": "bower install"
"test": "gulp test"
}
}

@@ -214,4 +214,9 @@ moment-recur

// The following matches every 1st and 3rd Thursday of the month.
// (Note this cannot be combined at the moment with every(x).months() expression)
cal = moment.recur().every("Thursday").daysOfWeek()
.every([0, 2]).weeksOfMonthByDay();
cal = moment.recur().every(moment("01/01/2014").day()).daysOfWeek()
.every(moment("01/01/2014").monthWeekByDay()).weeksOfMonthByDay();
```

@@ -218,0 +223,0 @@

@@ -287,2 +287,15 @@ 'use strict';

it("can recur on the 4th Wednesday of the month", function() {
var recurrence;
recurrence = moment.recur()
.every(moment('2017-09-27').day()).daysOfWeek()
.every(moment('2017-09-27').monthWeekByDay()).weeksOfMonthByDay();
expect(recurrence.matches(moment('2017-09-27'))).toBe(true);
expect(recurrence.matches(moment('2017-10-25'))).toBe(true);
expect(recurrence.matches(moment('2017-11-22'))).toBe(true);
expect(recurrence.matches(moment('2017-12-27'))).toBe(true);
});
it("will throw an error if used without daysOfWeek()", function() {

@@ -289,0 +302,0 @@ var recurrence, caught = { message: false };

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