Comments (7)
Sure. I will work on this, Mark @Defstun . I will try to squeeze this in during this week,,, Thanks.
from recurrencecalculator.
How about just using CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek? This way we do not need to add settings, @Defstun ?
On second thought explicit setting is better for backwards compatibility. I will just add a comment for folks how to set it and bump the version to 2.0
from recurrencecalculator.
Hi Sergey, thanks for responding and agreeing to do the work. 👍
The setting idea sounds much better as long as it can be changed at runtime. Perhaps through the construction of the class Calculator?
I can make the changes and send you a PR if that would help.
from recurrencecalculator.
Sure!. I do not say no to help, Mark :-).
from recurrencecalculator.
I've added a PR for it. I've added some tests that hopefully explains the issue we were having.
The logic of "If the first occurrence lands in the current week (indicated by the start date) then use it, if it does not then use the next interval date." was causing us issues when the first day of the week was Sunday. When having a weekly event on a Sunday with an interval > 1, it always chose the next interval, not the next occurrence of Sunday in the calendar.
With a configurable first day of the week, we can set this to Monday and it will choose the next occurrence of Sunday in the calculation, rather than the next interval.
Hope that all makes sense.
If the PR is not what you intended for a solution, obviously feel free to reject it but hopefully it's helped communicate the problem so you can add your own solution.
Again, thanks for responding to my issue. 👍
from recurrencecalculator.
Created a different PR and merged #15. Thanks for the help. I bumped version to 2.0, since some people may consider it a breaking change. I also moved the property to be set via constructor, as I thought this may reduce confusion and increase discoverability. Thanks again, Mark. @Defstun .
from recurrencecalculator.
Great, thanks.
from recurrencecalculator.
Related Issues (9)
- Should_Generate_Daily_Weekday_Recurrences_With_End_Date incorrect dates HOT 5
- It does not include first occurrence of pattern HOT 5
- order of date enumeration HOT 1
- Index HOT 3
- Day property in IRecurrence interface HOT 1
- Setting Days HOT 7
- Have appointment till end of time and to certain date? HOT 10
- Monthly Recurrence Calculation Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recurrencecalculator.