-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add status timpestamps #45
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
export type GrantData = Simplify< | ||
GrantWithoutTimestamps & { | ||
[k in GrantWithoutTimestamps["status"] as `${k}At`]?: number; | ||
} | ||
>; | ||
|
||
export type GrantDataWithBuilder = Simplify<GrantData & { builderData?: BuilderData }>; |
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.
Uncle Bob, is this you? 🤣
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.
This is perfect. Just added a commit to sort completed grants by date DESC
Description
timestamp
=>completedAt
inseed.sample.json
(Because of indentation updated, it looking like I added new stuff :( ) please let me know if I should revert it 🙌 and use 4 space indentation instead atcreatedAt
date on frontend cardsAlso a question currently we are generating timestamp as :
But I saw some people generate timestamp for firebase like this :
Basically storing its Timestamp object from firebase
And this is how it looks in the firebase document:
Here is chatGPT difference.
Basically,
FieldValue.serverTimestamp();
creates a placeholder value and uses timestamp which is generated while writing to firestore. People use this just to avoid using timestamp from client's system clock instead using firebase's cloack.Since we are not using firebase on client, it doest much affect us but another advantage of
FieldValue.serverTimestamp();
its more precise than JS Date since it stores value innanoseconds
where JS Date store inmilisecond
checkout thisPlease let me know if we should use
FieldValue.serverTimestamp();
, we will needing script to convert current seed timestamps(JS Date) to Firebase Timestamp, it should be though 🙌