Skip to content

feat: switch to 30 day month and 365 day year with leapless feature#63

Closed
elrafoon wants to merge 1 commit intochronotope:mainfrom
elrafoon:leapless
Closed

feat: switch to 30 day month and 365 day year with leapless feature#63
elrafoon wants to merge 1 commit intochronotope:mainfrom
elrafoon:leapless

Conversation

@elrafoon
Copy link

@elrafoon elrafoon commented Jan 1, 2026

Hello,

please consider merging this patch, that allows switching between 365.25/365 days per year and 30.44/30 days per month by enabling feature leapless.

I'm using humantime in project working with timeseries data, and the classic interpretation of 365d/y and 30d/m is required there.

I also think this can be a very common requirement in many other projects.

Thank you.

There are valid scenarios when 365.25day year and 30.44day month are
unusable or unexpected.
@djc
Copy link
Member

djc commented Jan 1, 2026

I don't think Cargo features are a good fit for API like this, because it subtly but drastically changes behavior at a distance when a crate that enables this feature is pulled into your dependency graph.

It's also clearly not a common requirement, since this is the first time it has come up (as far as I know).

As such, I don't think it makes sense to merge this.

@djc djc closed this Jan 1, 2026
@elrafoon
Copy link
Author

elrafoon commented Jan 1, 2026

Ok, understand, I also thought about that dependency graph problem.

So would you accept a new patch that would extend struct Parser and struct FormattedDuration to include leapless: bool, defaulting to false, and doing the same thing as the feature did?

@djc
Copy link
Member

djc commented Jan 4, 2026

Maybe, but it still feels like it would be pretty invasive relative to how niche your desired feature is.

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