@@ -291,9 +291,9 @@ const timeSpecSeparator = seq(dateTimeSeparator, timeSpec);
291291const dateSpecMonthDay = seq ( [ '--' ] , dateMonth , [ '-' ] , dateDay ) ;
292292const dateSpecYearMonth = seq ( dateYear , [ '-' ] , dateMonth ) ;
293293const date = choice ( seq ( dateYear , '-' , dateMonth , '-' , dateDay ) , seq ( dateYear , dateMonth , dateDay ) ) ;
294- const time = seq ( timeSpec , [ timeZone ] ) ;
295294const dateTime = seq ( date , [ timeSpecSeparator ] , [ timeZone ] ) ;
296295const calendarDateTime = seq ( dateTime , [ calendar ] ) ;
296+ const calendarTime = seq ( timeSpec , [ timeZone ] , [ calendar ] ) ;
297297
298298const durationFractionalPart = withCode ( between ( 1 , 9 , digit ( ) ) , ( data , result ) => {
299299 const fraction = result . padEnd ( 9 , '0' ) ;
@@ -353,10 +353,10 @@ const goals = {
353353 Date : calendarDateTime ,
354354 DateTime : calendarDateTime ,
355355 Duration : duration ,
356- MonthDay : choice ( dateSpecMonthDay , dateTime ) ,
357- Time : choice ( time , dateTime ) ,
356+ MonthDay : choice ( dateSpecMonthDay , calendarDateTime ) ,
357+ Time : choice ( calendarTime , calendarDateTime ) ,
358358 TimeZone : choice ( temporalTimeZoneIdentifier , seq ( date , [ timeSpecSeparator ] , timeZone , [ calendar ] ) ) ,
359- YearMonth : choice ( dateSpecYearMonth , dateTime ) ,
359+ YearMonth : choice ( dateSpecYearMonth , calendarDateTime ) ,
360360 ZonedDateTime : zonedDateTime
361361} ;
362362
@@ -378,10 +378,10 @@ const comparisonItems = {
378378 'microseconds' ,
379379 'nanoseconds'
380380 ] ,
381- MonthDay : [ 'month' , 'day' ] ,
382- Time : timeItems ,
381+ MonthDay : [ 'month' , 'day' , 'calendar' ] ,
382+ Time : [ ... timeItems , 'calendar' ] ,
383383 TimeZone : [ 'offset' , 'ianaName' ] ,
384- YearMonth : [ 'year' , 'month' ] ,
384+ YearMonth : [ 'year' , 'month' , 'calendar' ] ,
385385 ZonedDateTime : [ ...dateItems , ...timeItems , 'offset' , 'ianaName' , 'calendar' ]
386386} ;
387387const plainModes = [ 'Date' , 'DateTime' , 'MonthDay' , 'Time' , 'YearMonth' ] ;
0 commit comments