jefbarn / moment-recur-ts Goto Github PK
View Code? Open in Web Editor NEWConversion of the moment-recur library into TypeScript.
License: MIT License
Conversion of the moment-recur library into TypeScript.
License: MIT License
Calculate next/previous dates by adding/subtracting the period of the rule vs blindly checking every date.
May be i am doing something wrong, but
the same code
moment.recur({
start: '2019-03-01',
end: '2019-04-01',
})
.every([0, 1, 2, 3, 4, 5, 6]).daysOfWeek()
.every([0]).weeksOfMonthByDay()
.all('YYYY-MM-DD')
gives two different results, with default locale settings :
["2019-03-01", "2019-03-02", "2019-03-03", "2019-03-04", "2019-03-05", "2019-03-06", "2019-03-07", "2019-04-01"]
and with specified Monday as first week day
moment.locale('en', { week: { dow: 1 } })
["2019-03-01", "2019-03-02", "2019-03-04", "2019-03-05", "2019-03-06", "2019-03-07", "2019-04-01"]
2019-03-03
- is missing from results
0.1.2
to 0.1.3
.This version is covered by your current version range and after updating it in your project the build failed.
@types/clean-webpack-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
4.35.3
to 4.36.0
.This version is covered by your current version range and after updating it in your project the build failed.
webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
append
option now supports the default placeholders in addition to [url]
"..."
when overriding options.The new version differs by 42 commits.
95d21bb
4.36.0
aa1216c
Merge pull request #9422 from webpack/feature/dot-dot-dot-merge
b3ec775
improve merging of resolve and parsing options
53a5ae2
Merge pull request #9419 from vankop/remove-valid-jsdoc-rule
ab75240
Merge pull request #9413 from webpack/dependabot/npm_and_yarn/ajv-6.10.2
0bdabf4
Merge pull request #9418 from webpack/dependabot/npm_and_yarn/eslint-plugin-jsdoc-15.5.2
f207cdc
remove valid jsdoc rule in favour of eslint-plugin-jsdoc
31333a6
chore(deps-dev): bump eslint-plugin-jsdoc from 15.3.9 to 15.5.2
036adf0
Merge pull request #9417 from webpack/dependabot/npm_and_yarn/eslint-plugin-jest-22.8.0
37d4480
Merge pull request #9411 from webpack/dependabot/npm_and_yarn/simple-git-1.121.0
ce2a183
chore(deps-dev): bump eslint-plugin-jest from 22.7.2 to 22.8.0
0beeb7e
Merge pull request #9391 from vankop/create-hash-typescript
bf1a24a
#9391 resolve super call discussion
bd7d95b
#9391 resolve discussions, AbstractMethodError
4190638
chore(deps): bump ajv from 6.10.1 to 6.10.2
There are 42 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
In these examples, I would expect the result to not include '07/18/2018' and instead would return
['07/25/2018', '08/01/2018']
As an example:
const wedRecur = moment.recur().every('Wednesday').daysOfWeek()
const today = moment('07/18/2018')
if (wedRecur.matches(today)) {
wedRecur.fromDate(today).next(2, 'L')
}
const wedRecur = moment.recur().every(3).daysOfWeek()
const today = moment('07/18/2018')
if (wedRecur.matches(today)) {
wedRecur.fromDate(today).next(2, 'L') // ['07/18/2018', '07/25/2018']
}
Add hour/minute/second/millisecond recurrence rules
Timezones and Daylight Saving may become a problem.
Use the UTC mode of the start date to determine what format the return moments should be in.
Provide compiled ES6 modules.
ES6 modules will likely be complied without polyfills. Assumption is that anyone using ES6 modules either is using a newer runtime, or is capable of providing their own polyfills.
Hi,
I noticed that recur().every(["Monday","Tuesday"]).daysOfWeek().every(2).weeks()
only returns "Monday" results.
I'm using moment-range because of it's powerful querying as I need to check whether a certain range lays within another range. Basically, I have different seasons and I need to check whether a period of time lays within that season.
However, as those seasons are recurring every year I was wondering whether it was possible to make moment-recur-ts work with moment-range? Do you have any idea how I could achieve it? I've tried everything I could think of and am kind of stuck here. Any advice highly appreciated!
Could add some code to short circuit a rule that will never match.
4.4.11
to 4.4.12
.This version is covered by your current version range and after updating it in your project the build failed.
@types/webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.