@@ -180,11 +180,6 @@ impl PlainYearMonth {
180180 self . calendar . identifier ( )
181181 }
182182
183- /// Returns the calendar day value.
184- pub fn day ( & self ) -> TemporalResult < u8 > {
185- self . calendar . day ( & self . iso )
186- }
187-
188183 /// Creates a `PlainYearMonth` using the fields provided from a [`PartialDate`]
189184 pub fn with (
190185 & self ,
@@ -194,9 +189,6 @@ impl PlainYearMonth {
194189 // 1. Let yearMonth be the this value.
195190 // 2. Perform ? RequireInternalSlot(yearMonth, [[InitializedTemporalYearMonth]]).
196191 // 3. If ? IsPartialTemporalObject(temporalYearMonthLike) is false, throw a TypeError exception.
197- if partial. is_empty ( ) {
198- return Err ( TemporalError :: r#type ( ) . with_message ( "A PartialDate must have a field." ) ) ;
199- } ;
200192 // 4. Let calendar be yearMonth.[[Calendar]].
201193 // 5. Let fields be ISODateToFields(calendar, yearMonth.[[ISODate]], year-month).
202194 // 6. Let partialYearMonth be ? PrepareCalendarFields(calendar, temporalYearMonthLike, « year, month, month-code », « », partial).
@@ -345,7 +337,7 @@ mod tests {
345337 assert_eq ! ( with_year. iso_year( ) , 2001 ) ; // year is changed
346338 assert_eq ! ( with_year. iso_month( ) , 3 ) ; // month is not changed
347339 assert_eq ! (
348- with_year. month_code( ) . unwrap ( ) ,
340+ with_year. month_code( ) ,
349341 MonthCode :: from_str( "M03" ) . unwrap( )
350342 ) ; // assert month code has been initialized correctly
351343
@@ -358,7 +350,7 @@ mod tests {
358350 assert_eq ! ( with_month. iso_year( ) , 2025 ) ; // year is not changed
359351 assert_eq ! ( with_month. iso_month( ) , 2 ) ; // month is changed
360352 assert_eq ! (
361- with_month. month_code( ) . unwrap ( ) ,
353+ with_month. month_code( ) ,
362354 MonthCode :: from_str( "M02" ) . unwrap( )
363355 ) ; // assert month code has changed as well as month
364356
@@ -370,7 +362,7 @@ mod tests {
370362 let with_month_code = base. with ( partial, None ) . unwrap ( ) ;
371363 assert_eq ! ( with_month_code. iso_year( ) , 2025 ) ; // year is not changed
372364 assert_eq ! (
373- with_month_code. month_code( ) . unwrap ( ) ,
365+ with_month_code. month_code( ) ,
374366 MonthCode :: from_str( "M05" ) . unwrap( )
375367 ) ; // assert month code has changed
376368 assert_eq ! ( with_month_code. iso_month( ) , 5 ) ; // month is changed as well
@@ -383,7 +375,7 @@ mod tests {
383375 let with_day = base. with ( partial, None ) . unwrap ( ) ;
384376 assert_eq ! ( with_day. iso_year( ) , 2025 ) ; // year is not changed
385377 assert_eq ! ( with_day. iso_month( ) , 3 ) ; // month is not changed
386- assert_eq ! ( with_day. iso. day, 15 ) ; // day is changed
378+ assert_eq ! ( with_day. iso. day, 1 ) ; // day is ignored
387379
388380 // All
389381 let partial = PartialDate {
@@ -395,7 +387,7 @@ mod tests {
395387 let with_all = base. with ( partial, None ) . unwrap ( ) ;
396388 assert_eq ! ( with_all. iso_year( ) , 2001 ) ; // year is changed
397389 assert_eq ! ( with_all. iso_month( ) , 2 ) ; // month is changed
398- assert_eq ! ( with_all. iso. day, 15 ) ; // day is changed
390+ assert_eq ! ( with_all. iso. day, 1 ) ; // day is ignored
399391 }
400392
401393 #[ test]
0 commit comments