Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/builtins/core/plain_year_month.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,11 @@ impl PlainYearMonth {
// Useful for implementing HandleDateTimeTemporalYearMonth
pub fn epoch_ns_for_utc(&self) -> EpochNanoseconds {
// 2. Let isoDateTime be CombineISODateAndTimeRecord(temporalYearMonth.[[ISODate]], NoonTimeRecord()).
let iso = IsoDateTime::new(self.iso, IsoTime::noon());
debug_assert!(iso.is_ok());
// new_unchecked: PYM is supposed to support year-months outside of the ISO range as well as long
// as the year is in range
let iso = IsoDateTime::new_unchecked(self.iso, IsoTime::noon());
// 3. Let epochNs be ? GetUTCEpochNanoseconds(isoDateTime).
iso.unwrap_or_default().as_nanoseconds()
iso.as_nanoseconds()
}

/// Returns a RFC9557 IXDTF string for the current `PlainYearMonth`
Expand Down