Giter Site home page Giter Site logo

Comments (7)

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

Sure. I will work on this, Mark @Defstun . I will try to squeeze this in during this week,,, Thanks.

from recurrencecalculator.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

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.

Defstun avatar Defstun commented on September 13, 2024

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.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

Sure!. I do not say no to help, Mark :-).

from recurrencecalculator.

Defstun avatar Defstun commented on September 13, 2024

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.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

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.

Defstun avatar Defstun commented on September 13, 2024

Great, thanks.

from recurrencecalculator.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.