Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Duration documentation to document different behaviour when created out of factory methods #1627

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KlausNie
Copy link

@KlausNie KlausNie commented May 15, 2024

  • include note relevant methods
  • include reference to documentation

Ref: #1626

* include reference to different behaviour for Durations created out of factory methods
Copy link

linux-foundation-easycla bot commented May 15, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link
Collaborator

@diesieben07 diesieben07 left a comment

Choose a reason for hiding this comment

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

Unfortunately the documentation you have added is factually not correct.
I also don't think we should be copy pasting the same text at all the accessors.

Comment on lines +868 to +869
* Note: Durations created out of Duration.from* (e.g. fromObject) factories will always yield 0.
* This will give you the correct difference in years, if the Duration was created out of a diff operation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is factually incorrect. Duration.fromObject({ years: 2 }).years is 2, not 0.
I am not sure what you're referring to by "correct difference in years" here.

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