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

Refactor time_span.py to use an int representation instead of timedelta #3608

Merged
merged 8 commits into from
Nov 25, 2023

Conversation

MangelMaxime
Copy link
Member

@MangelMaxime MangelMaxime commented Nov 22, 2023

  • Add tests to check that TotalXXX, Days, Seconds, etc. returns the expected value

TimeSpan precision is at the Ticks levels, in .NET the precision is nanoseconds but I have no idea how to implement it correctly.

The TimeSpan constructor goes up to Tick levels so we can't create a TimeSpan based on the nanosecond value.

For this reason, I am making Fable emit an error if the user tries to use any of the Nanoseconds getter.

CleanShot 2023-11-24 at 16 11 27@2x

@MangelMaxime MangelMaxime force-pushed the feature/timespan_as_number branch from 48960a1 to f17051f Compare November 24, 2023 14:55
@MangelMaxime MangelMaxime changed the title WIP: Refactor time_span.py to use an int representation instead of timedelta Refactor time_span.py to use an int representation instead of timedelta Nov 24, 2023
@dbrattli
Copy link
Collaborator

Looks good, just remember all variables should be snake_cased

@MangelMaxime
Copy link
Member Author

Right, thank you for the review.

I fixed the naming, I will release a new version of Fable tomorrow or on monday, I think we already have a lot of improvement made in the main branch

@MangelMaxime MangelMaxime merged commit 91781c5 into main Nov 25, 2023
@MangelMaxime MangelMaxime deleted the feature/timespan_as_number branch November 25, 2023 20:35
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