feat!: use gleam_time internally for Time representation#54
Open
tylerbutler wants to merge 2 commits intomassivefermion:mainfrom
Open
feat!: use gleam_time internally for Time representation#54tylerbutler wants to merge 2 commits intomassivefermion:mainfrom
tylerbutler wants to merge 2 commits intomassivefermion:mainfrom
Conversation
BREAKING CHANGES: - Time type now uses timestamp.Timestamp and time_duration.Duration internally - TimeOfDay.milli_second field renamed to nanosecond (now stores nanoseconds) - unix_epoch changed from constant to function: unix_epoch() New features: - Added get_milli_second() deprecated helper for TimeOfDay backward compatibility - Added NanoSecond to duration.Unit enum - Added duration.nano_seconds() constructor - Added gleam_time interop: to_gleam_timestamp(), from_gleam_timestamp(), to_unix_nano(), from_unix_nano(), get_offset_duration() - Added duration interop: to_gleam_duration(), from_gleam_duration() FFI changes: - Removed now(), local_offset(), to_parts(), from_parts() (now provided by gleam_time) - Kept monotonic_now(), weekday(), local_timezone() (not provided by gleam_time) Version bumped to 2.0.0 for breaking changes.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gleam_timeas the foundationBreaking Changes
Timetype now usestimestamp.Timestampandtime_duration.DurationinternallyTimeOfDay.milli_secondfield renamed tonanosecond(now stores nanoseconds)unix_epochchanged from constant to function:unix_epoch()New Features
get_milli_second()deprecated helper for TimeOfDay backward compatibilityNanoSecondtoduration.Unitenumduration.nano_seconds()constructorto_gleam_timestamp()/from_gleam_timestamp()to_unix_nano()/from_unix_nano()get_offset_duration()to_gleam_duration()/from_gleam_duration()FFI Changes
now(),local_offset(),to_parts(),from_parts()(now provided by gleam_time)monotonic_now(),weekday(),local_timezone()(not provided by gleam_time)Test Plan
act -j testgleam format --check src testpasses