@@ -291,9 +291,9 @@ const timeSpecSeparator = seq(dateTimeSeparator, timeSpec);
291
291
const dateSpecMonthDay = seq ( [ '--' ] , dateMonth , [ '-' ] , dateDay ) ;
292
292
const dateSpecYearMonth = seq ( dateYear , [ '-' ] , dateMonth ) ;
293
293
const date = choice ( seq ( dateYear , '-' , dateMonth , '-' , dateDay ) , seq ( dateYear , dateMonth , dateDay ) ) ;
294
- const time = seq ( timeSpec , [ timeZone ] ) ;
295
294
const dateTime = seq ( date , [ timeSpecSeparator ] , [ timeZone ] ) ;
296
295
const calendarDateTime = seq ( dateTime , [ calendar ] ) ;
296
+ const calendarTime = seq ( timeSpec , [ timeZone ] , [ calendar ] ) ;
297
297
298
298
const durationFractionalPart = withCode ( between ( 1 , 9 , digit ( ) ) , ( data , result ) => {
299
299
const fraction = result . padEnd ( 9 , '0' ) ;
@@ -353,10 +353,10 @@ const goals = {
353
353
Date : calendarDateTime ,
354
354
DateTime : calendarDateTime ,
355
355
Duration : duration ,
356
- MonthDay : choice ( dateSpecMonthDay , dateTime ) ,
357
- Time : choice ( time , dateTime ) ,
356
+ MonthDay : choice ( dateSpecMonthDay , calendarDateTime ) ,
357
+ Time : choice ( calendarTime , calendarDateTime ) ,
358
358
TimeZone : choice ( temporalTimeZoneIdentifier , seq ( date , [ timeSpecSeparator ] , timeZone , [ calendar ] ) ) ,
359
- YearMonth : choice ( dateSpecYearMonth , dateTime ) ,
359
+ YearMonth : choice ( dateSpecYearMonth , calendarDateTime ) ,
360
360
ZonedDateTime : zonedDateTime
361
361
} ;
362
362
@@ -378,10 +378,10 @@ const comparisonItems = {
378
378
'microseconds' ,
379
379
'nanoseconds'
380
380
] ,
381
- MonthDay : [ 'month' , 'day' ] ,
382
- Time : timeItems ,
381
+ MonthDay : [ 'month' , 'day' , 'calendar' ] ,
382
+ Time : [ ... timeItems , 'calendar' ] ,
383
383
TimeZone : [ 'offset' , 'ianaName' ] ,
384
- YearMonth : [ 'year' , 'month' ] ,
384
+ YearMonth : [ 'year' , 'month' , 'calendar' ] ,
385
385
ZonedDateTime : [ ...dateItems , ...timeItems , 'offset' , 'ianaName' , 'calendar' ]
386
386
} ;
387
387
const plainModes = [ 'Date' , 'DateTime' , 'MonthDay' , 'Time' , 'YearMonth' ] ;
0 commit comments