Open khawarizmus opened 4 months ago
disambiguation
is only used for dealing with repeated or skipped hours caused by time zone transitions. But the spec you linked above refers only to dates, not times. So using disambiguation
in that context is probably not correct, unless there's some other part of the spec that requires applying the same SKIP
behavior to times too.
overflow: 'reject'
will throw, and I'm not sure if this is the behavior you want from OMIT
unless you're catching the exception upstream.
To get FORWARD
or BACKWARD
behavior, you'd probably want to use overflow: 'reject'
, catch the exception, and then call add
in a loop until you get a date whose day
matches the original day
.
I am currently looking at the
SKIP
property in section 4.1 of RFC 7529. and specifically this part:With that in mind I see that it's possible to implement the
OMIT
option by usingoverflow: reject
option in temporal. However I don't see any controls offered by theoverflow
option to decide if clamping for example when usingoverflow: constrain
should go forward or backward.currently i have the following logic where i combine it with the
disambiguation
option but i think it's not really serving the purpose.Is the above implementation correct and if not what's the proper approach?