Error with post.pubDate?. is not a function
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 65
- Forks
- 13
- Avg merge
- 1m
- Merged PRs (30d)
- 6
Description
In the getting started guide with Next.js, I discovered this error under the query and list posts section and fixed it with a function as shown below. It was possible as I passed the data in the function.
function getCurrentDate(date) {
return new Date(date)
}
JSX
<p className="text-xs mb-2 text-purple-950 dark:text-purple-200">{getCurrentDate(post.pubDate)?.toDateString()}</p>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the Xata Next.js getting started guide at the linked URL and go to the query and list posts section. Compare the published example with the error and reported date conversion, then update the guide so the example handles post.pubDate correctly and verify the shown snippet no longer produces the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100