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).
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
DateTime::from_date_and_time
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.TemporalFields
from aPartialDate
. Primarily, after doing the implementation, I don't think having aFrom<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 tocalendar::create_fields_from_partial_date(partial_date)
.