Andidy / finance-app

A Finance / Budgeting Application to refresh my C# knowledge and Learn WPF
0 stars 0 forks source link

Handle Finance Events with Recurring Intervals #13

Open Andidy opened 3 years ago

Andidy commented 3 years ago

Currently, a Finance Event with a Weekly, Monthly, Quaterly or Yearly interval doesn't repeat itself if the calculation date is set far enough forward for it to be able to.

For weekly events the event should repeat on the same day each week (if the date is set as Sunday Jan 1st, then it should repeat every Sunday)

For monthly events, the event should repeat on the same date each month (sunday jan 1st would repeat on the 1st of every month)

Im not sure how to handle quarterly.

Yearly events should repeat on the same date each year (Sunday Jan 1st would repeat on Jan 1st each year)

Andidy commented 3 years ago

Perhaps for quarters it could be an offset from the first day of each quarter, meaning for quarter 1 it would be Jan 1st as the start, Quarter 2 would be April 1st, Q3 would be July 1st, Q4 would be October 1st.

The issue is that not all quarters are the same length, as Q1 as a base means that Q2 has 1 extra day and Q3 and Q4 have 2 extra days. The extra days could probably just be clamped to the last day for the shorter quarters so I think this is fine.