-
Notifications
You must be signed in to change notification settings - Fork 19
Since until #259
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
Since until #259
Conversation
…Tennebekk/temporal into add-since-until-yearmonth
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.
Looks great! All the extra tests looks great!
I had one thing I noticed and then a general thought/nit (this one isn't necessarily blocking though). Although, it does look like there are some clippy lints that need to be fixed as well to be able to merge.
src/builtins/core/year_month.rs
Outdated
// 15. Let duration be CombineDateAndTimeDuration(yearsMonthsDifference, 0). | ||
let mut duration = NormalizedDurationRecord::from_date_duration(*result.date())?; | ||
// 16. If settings.[[SmallestUnit]] is not month or settings.[[RoundingIncrement]] ≠ 1, then | ||
if settings.smallest_unit != Some(TemporalUnit::Month) |
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.
issue: I believe this should be using the resolved options in resolved
.
src/options.rs
Outdated
// 1. NOTE: The following steps read options and perform independent validation in alphabetical order. | ||
// 2. Let largestUnit be ? GetTemporalUnitValuedOption(options, "largestUnit", unitGroup, auto). | ||
// Week and day is the only use case where any of the units are not allowed. | ||
if dissallow_week_and_day { |
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.
thought: is there anything preventing moving this into PlainYearMonth::diff
vs. where it's currently at in ResolvedRoundingOptions::from_diff_settings
.
This only affects the one code path from PlainYearMonth
, I think, so maybe this could work in PlainYearMonth::diff
. This would then avoid the check occurring for the other callers.
…resolved from settings in diff and moved logic from options.rs from_diff_setting into diff
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.
Looks good to me! Thanks for working on this!
EDIT: I think all this needs is a rebase / merge and it should be good to go
fixes #142
Worked with @HenrikTennebekk and @Magnus-Fjeldstad
Implementation for since and until in PlainYearMonth, has not yet been tested with boa test262