-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: add function to wrap block_timestamp in PlainDateTime object #498
Conversation
so that users won't need to know how it is initialized. Signed-off-by: Ashutosh Varma <ashutoshvarma11@live.com>
This is weird 🤔
|
Once these are merged, the test should pass, for now, it is disabled with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a small nit in the comment.
Co-authored-by: Willem Wyndham <willem@cs.umd.edu>
Summary
assemblyscript-temporal is tc39-temporal based featureful datetime assemblyscipt library.
This PR integrates the above library with near-sdk-as.
Changes
This PR introduces a new namespace
datetime
which hasblock_datetime()
function.block_datetime()
- Current block date time. Returns PlainDateTime object initializes with current block timestamp.Example
Additional Notes
Temporarily we need to use this ugly import to access UTC getter methods on Date.
https://github.com/ashutoshvarma/near-sdk-as/blob/3070ae69852e5376236ae1bc7cef6f74a3bc1ac8/sdk-core/assembly/datetime.ts#L6
But once this PR AssemblyScript/assemblyscript#1768 is merged, then it can be safely removed.