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

output of subtraction and addition #40

Open
jjb opened this issue Nov 15, 2016 · 1 comment
Open

output of subtraction and addition #40

jjb opened this issue Nov 15, 2016 · 1 comment

Comments

@jjb
Copy link
Contributor

jjb commented Nov 15, 2016

I was surprised to find that a duration is represented with a Tod::TimeOfDay. This seems semantically incorrect. It seems it should be either some sort of new class representing a period of time or just a float representing seconds, as is done in other libraries.

Would you be open to changing this behavior for the next major version release?

> noon = Tod::TimeOfDay.new(12)
> afternoon = Tod::TimeOfDay.new(14)
> d = afternoon-noon
=> #<Tod::TimeOfDay:0x0000000559f038 @hour=2, @minute=0, @second=0, @second_of_day=7200>
> d.to_i / 60 / 60
=> 2
@jackc
Copy link
Owner

jackc commented Nov 16, 2016

Yeah, that looks weird to me now, too. Don't remember what the reason was. So I guess unless the original reason surfaces I'm open to changing in a next major version.

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

No branches or pull requests

2 participants