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

Fix the computation of total seconds with years and months #482

Merged

Conversation

sdispater
Copy link
Owner

Resolves #479
Resolves #475

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

@sdispater sdispater force-pushed the fix-total-seconds-computation-with-years-and-months branch from 4ab7fb4 to 9274f5c Compare July 4, 2020 22:29
@sdispater sdispater force-pushed the fix-total-seconds-computation-with-years-and-months branch from 9274f5c to 834ff81 Compare July 4, 2020 22:32
@sdispater sdispater merged commit fb2e860 into master Jul 4, 2020
@sdispater sdispater deleted the fix-total-seconds-computation-with-years-and-months branch July 4, 2020 22:46
@sdispater sdispater mentioned this pull request Jul 13, 2020
@jacobg
Copy link

jacobg commented Jun 8, 2022

This commit breaks the following:

>>> dt = pendulum.DateTime(2022, 6, 8, 13, 21, 12, 239829, tzinfo=pendulum._Timezone('America/New_York'))
>>> dt._add_timedelta(datetime.timedelta(seconds=3600))
DateTime(2022, 6, 8, 14, 21, 12, 239829, tzinfo=Timezone('America/New_York'))

The _add_timedelta call is a no-op.

@jacobg jacobg mentioned this pull request Jun 8, 2022
@jacobg
Copy link

jacobg commented Jun 8, 2022

The problem is it's calling pendulum.Date.add_timedelta instead of pendulum.DateTime.add_timedelta, even though it's a DateTime object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants