-
Notifications
You must be signed in to change notification settings - Fork 323
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
Adding DateTime part functions #3669
Conversation
Move Time_Error to Error.Common. Failing tests for parse
Refactor to date part tests shared.
Added ISO support to week_of_year.
d380b85
to
da23c59
Compare
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Day_Of_Week.enso
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the Zone -> Time_Zone
rename, I think it's much clearer now.
I don't understand why in many places we roll our own logic instead of relying on available Java utils (which are rather commonly used so I think we can rely on them without adding tons of tests).
Still, I'm not sure Java is prepared for handling dates prior to 1AD very well, which is understandable as most usecases do not care about such dates. Still, I think according to the philosophy of avoiding data corruption at all costs and preferring crashes to data corruption - I think we should consciously throw an exception for operations that we know that would lead to wrong results. So I think we should either add a few tests for BC dates to make sure they work correctly OR throw exceptions saying explicitly that our tool does not support these kinds of dates.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
Test for Day_Of_Week.
Pull Request Description
Zone
,Date_Time
andTime_Of_Day
toStandard.Base
.Zone
toTime_Zone
.century
.is_leap_year
.length_of_year
.length_of_month
.quarter
.day_of_year
.Day_Of_Week
type andday_of_week
function.week_of_year
to support ISO.Important Notes
week_of_year
to use ISO.Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.