Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Unicode minus sign in negative durations and time zone offsets #814

Closed
ptomato opened this issue Aug 12, 2020 · 4 comments · Fixed by #826
Closed

Accept Unicode minus sign in negative durations and time zone offsets #814

ptomato opened this issue Aug 12, 2020 · 4 comments · Fixed by #826
Assignees

Comments

@ptomato
Copy link
Collaborator

ptomato commented Aug 12, 2020

Follow up from #811 (comment)

From ISO 8601:

The representations specified in this International Standard make use of graphic characters as specified in 3.4. Note that, except for “hyphen”, “minus” and “plus-minus”, these characters are part of the ISO/IEC 646 repertoire. In an environment where use is made of a character repertoire based on ISO/IEC 646, “hyphen” and “minus” are both mapped onto “hyphen-minus”. Representations with a “plus-minus” shall only be used in such environment if the interchange repertoire includes “plus-minus”.

(ISO/IEC 646 is 7-bit ASCII. Certainly we should continue emitting ASCII-only strings for ease of interchange, but I think it would be OK to accept Unicode minus signs since JS is not limited to ASCII.)

@justingrant
Copy link
Collaborator

Note that this applies in two places: parsing UTC offsets and parsing negative durations. BTW, "unicode minus" is U+2212.

@sffc
Copy link
Collaborator

sffc commented Aug 13, 2020

Makes sense if it's in the spec.

@ptomato
Copy link
Collaborator Author

ptomato commented Aug 14, 2020

It also applies to negative 6-digit extended years.

ptomato added a commit that referenced this issue Aug 15, 2020
Wherever a sign character is needed (in 6-digit extended years and in
time zone offsets), also accept the Unicode minus sign as well as the
normal ASCII + and -.

Closes: #814
@ptomato ptomato self-assigned this Aug 15, 2020
@ptomato
Copy link
Collaborator Author

ptomato commented Aug 15, 2020

I'll also tack this on to the negative durations pull request (#811).

ptomato added a commit that referenced this issue Aug 15, 2020
Wherever a sign character is needed (in 6-digit extended years and in
time zone offsets), also accept the Unicode minus sign as well as the
normal ASCII + and -.

Closes: #814
ptomato added a commit that referenced this issue Aug 24, 2020
Wherever a sign character is needed (in 6-digit extended years and in
time zone offsets), also accept the Unicode minus sign as well as the
normal ASCII + and -.

Closes: #814
ptomato added a commit that referenced this issue Aug 24, 2020
Wherever a sign character is needed (in 6-digit extended years and in
time zone offsets), also accept the Unicode minus sign as well as the
normal ASCII + and -.

Closes: #814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants