Skip to content

Patch for partial records#94

Merged
nekevss merged 3 commits intomainfrom
patch-partials
Aug 19, 2024
Merged

Patch for partial records#94
nekevss merged 3 commits intomainfrom
patch-partials

Conversation

@nekevss
Copy link
Copy Markdown
Member

@nekevss nekevss commented Aug 16, 2024

This PR is a patch for some things I found while doing some implementation of temporal_rs in Boa.

The things the PR addresses / patches

  • Adds a DateTime::from_date_and_time
  • I noticed that the with methods weren't checking whether the partials were empty, which would not be valid. This update throws an early error if the partial provided is empty.
  • Changed the internal way for constructing a TemporalFields from a PartialDate. Primarily, after doing the implementation, I don't think having a From<PartialDate> for TemporalFields is a good idea. We will still need it internally, but I'm now leaning more towards using the calendar to generate the fields from a partial. Something akin to calendar::create_fields_from_partial_date(partial_date).

@nekevss nekevss added the C-internal Internal library improvements label Aug 16, 2024
Copy link
Copy Markdown
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Only found a typo which doesn't block merging this.

Comment thread src/fields.rs Outdated
Ok(result)
}

/// Creates a `TemporalFeild` from a `PartialDate`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Creates a `TemporalFeild` from a `PartialDate`.
/// Creates a `TemporalField` from a `PartialDate`.

@nekevss nekevss merged commit 1e7901d into main Aug 19, 2024
@nekevss nekevss deleted the patch-partials branch November 5, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-internal Internal library improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants