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

Sending Date using Webhook not working #1487

Closed
abdoil opened this issue Nov 16, 2023 · 2 comments
Closed

Sending Date using Webhook not working #1487

abdoil opened this issue Nov 16, 2023 · 2 comments

Comments

@abdoil
Copy link

abdoil commented Nov 16, 2023

Describe the bug
i was trying to send data to rowy via webhook, all the other data are sent successfully except for Date, I tried sending as an object like this
"posted":{"seconds":1681272000,"nanoseconds":0}
and also in the format as yyyy-MM-dd. but still shows as blank. Here is a screenshot of how the data is

image

To Reproduce
Trying by sending the date as object to Webhook

Expected behavior
Nothing shows (Empty)

Rowy Run version
Cloud Version

@abdoil abdoil changed the title Sending Date using Webhook Sending Date using Webhook not working Nov 16, 2023
@uudens
Copy link

uudens commented Nov 21, 2023

I was able to get it working using the Timestamp class.
Try to put something like this inside your webhook body:

const { default: { Timestamp } } = await import("@google-cloud/firestore");
const ts = Date.now();
return { posted: Timestamp.fromMillis(ts) };

@Chadha93
Copy link
Member

Chadha93 commented Jan 9, 2024

I was able to get it working using the Timestamp class. Try to put something like this inside your webhook body:

const { default: { Timestamp } } = await import("@google-cloud/firestore");
const ts = Date.now();
return { posted: Timestamp.fromMillis(ts) };

Thanks @uudens.
@abdoil, You can follow the above approach to solve this, closing this issue. Thanks.

@Chadha93 Chadha93 closed this as completed Jan 9, 2024
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

No branches or pull requests

3 participants