Skip to content

Propose tezDate type. Minimal tests#5

Open
grum-tez wants to merge 3 commits intocompletium:mainfrom
grum-tez:tezDate
Open

Propose tezDate type. Minimal tests#5
grum-tez wants to merge 3 commits intocompletium:mainfrom
grum-tez:tezDate

Conversation

@grum-tez
Copy link
Contributor

@grum-tez grum-tez commented Dec 1, 2022

I was having a lot of problems dealing with interoperability between the native js dates and the tezos duration types - mostly because the native JS dates are in milliseconds and the tezos dates are in seconds (but also because durations take a string as input)

This is my naive attempt to address this. I don't know enough about how bindings work to figure out how to input tezDate into the contracts via entrypoints and deploy - but I got around this by adding a 'toDate' method.

If there is a much easier way to deal with this problem just using inbuilt methods or something, please just let me know!

If something like this is useful, I'm happy to write more complete tests

@grum-tez grum-tez closed this Dec 5, 2022
@grum-tez grum-tez reopened this Dec 5, 2022
@grum-tez
Copy link
Contributor Author

grum-tez commented Dec 5, 2022

Now I understand a bit more about how horrible dates are to work I can see that incorporating something like this is very complicated. However I'm finding the addDuration methods useful in my project (after fixing some glaring bugs) so I'll just leave it here

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.

1 participant