Skip to content

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

Merged
zigge-zagge merged 1 commit intomainfrom
jz-adds-timestamp-to-typespec
Aug 16, 2023
Merged

fix: Adds erlang:timestamp() to typespec#2
zigge-zagge merged 1 commit intomainfrom
jz-adds-timestamp-to-typespec

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
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