(Decline to?) define a partial ordering for Timestamp
ion-schema's valid_values constraint (currently being implemented in amzn/ion-schema-kotlin#163) allows users to specify a range of acceptable timestamps. However, it is unclear how any given timestamp can be determined to be in that range. (More fundamentally, it is not always clear whether the provided min bound is less than the provided max bound.)
When comparing two timestamps for equality, they must have:
- The same precision.
- The same timezone offset (including
unknown). Adjusting onetimestampto compare across offsets is not allowed.
It's unclear how precision and offset should come into play for ordering. 1992T is ostensibly before 2007-06T, but they're different precisions. Is this comparison allowed? What about 1992T vs 1992-06T? Perhaps when sorting them, higher precisions come later?
A partial ordering over timestamp seems possible. We should either prescribe a definition or explicitly decline to do so, allowing users like ion-schema to define their own.
This has been explained by https://github.com/amzn/ion-schema/pull/34 based on decimal ordering.