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

fix: Adds erlang:timestamp() to typespec #2

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

zigge-zagge
Copy link

This is supported in jsx_parser which calls calendar:now_to_datetime/1 for these timestamps.

Opened a PR here as well but it seems like this project is not alive any more.

The reason:

The call jsx:encode(Timestamp::{_,_,_}) will never return since the success typing is
(atom() | binary() | [any()] | number() | {{non_neg_integer(),1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12,1..255},{byte(),byte(),byte()}} | map()) -> binary()
and the contract is (Source::json_term()) -> json_text()

This is supported in jsx_parser which calls calendar:now_to_datetime/1
for these timestamps.
@zigge-zagge
Copy link
Author

This commit has been added on top of 2.9.0 here: https://github.com/kivra/jsx/commits/2.9.0-kivra

@zigge-zagge zigge-zagge merged commit fbdc21a into main Aug 16, 2023
0 of 6 checks passed
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 this pull request may close these issues.

2 participants