Skip to content

Conversation

esheppa
Copy link
Collaborator

@esheppa esheppa commented Oct 31, 2022

This has been separated out from #824

@esheppa esheppa changed the base branch from main to 0.4.x October 31, 2022 12:07
@esheppa esheppa changed the base branch from 0.4.x to main October 31, 2022 12:07
/// MonthsDelta::Backwards(Months::new(13))
/// );
/// ```
pub fn months_since(self, rhs: NaiveDate) -> MonthsDelta {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what was the use case for adding this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly for API consistency, we have Duration and TimeDelta, Days and DateDelta and here Months and MonthsDelta.

Calculating the calendar months between two dates is often useful in financial / accounting style calculations, but it is admittedly a narrow use case, and could be better served in an external library

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you have a concrete use case for this in the near future, I would propose that we leave this out for now. We already have a lot to work through in this crate, so better not to add more code unless we have a somewhat strong proof that we need/want it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@esheppa esheppa closed this Nov 2, 2022
@pitdicker pitdicker deleted the add-month-delta branch April 9, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants