Giter Site home page Giter Site logo

Comments (5)

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

Do you have an example to share?

from recurrencecalculator.

codeparksoftware avatar codeparksoftware commented on September 13, 2024

StartDate=12/31/2019
DayOfMonth=31
interval=1
Occurrences=10
MonthOfYear=12
RecurrenceType=YearInstance
Tuesday=true
image
It generates dates by starting next year.
I think the problem causes due to startdate and creationdate equals. when I set startdate as one day ago then there is no problem.
If creation time of day older than event time of day for the same date I agree it should not show. But if event time of day older than creation time of day it should show the start date as next occurrence.

from recurrencecalculator.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

I do not see the behavior you describe.
Here is my test and it passes. Could you provide similar test that fails to assist?

Thank you,

[TestMethod]
public void Should_Generate_Yearly_Recurrences_With_End_Date_Same_Start_Date()
{
var recurrence = new AppointmentRecurrence
{
RecurrenceType = RecurrenceType.Yearly,
Interval = 1,
DayOfMonth = 31,
MonthOfYear = 12,
Sunday = true,
Monday = true,
Tuesday = true,
Wednesday = true,
Thursday = true,
Friday = true,
Saturday = true,
StartDate = new DateTime(2019, 12, 31),
Occurrences = 3
};
var occurrences = _calendarUtility.CalculateOccurrences(recurrence).ToList();
Assert.AreEqual(3, occurrences.Count, "Should create 3 occurrences");
Assert.AreEqual(new DateTime(2019, 12, 31), occurrences[0], "Date 1 should be correct");
Assert.AreEqual(new DateTime(2020, 12, 31), occurrences[1], "Date 2 should be correct");
Assert.AreEqual(new DateTime(2021, 12, 31), occurrences[2], "Date 3 should be correct");
}

from recurrencecalculator.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

Fixed in this PR: #4.
The issue is that yearly recurrence looks at time of the start date instead of just date, like other recurrences.

from recurrencecalculator.

SergeyBarskiy avatar SergeyBarskiy commented on September 13, 2024

Version 1.0.4 has been published to NuGet.

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.