Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

datePublished & dateModified props - why nulls? #86

Closed
rwasiak opened this issue Jun 15, 2020 · 3 comments
Closed

datePublished & dateModified props - why nulls? #86

rwasiak opened this issue Jun 15, 2020 · 3 comments

Comments

@rwasiak
Copy link

rwasiak commented Jun 15, 2020

Hello 👋

great component!

I've found one interesting thing.

datePublished: datePublished
? null
: new Date(Date.now()).toISOString(),
dateModified: dateModified
? null
: new Date(Date.now()).toISOString(),

Why there is a null replacement when datePublished or dateModified is provided? Is there any reason for SEO or it is just an oversight?

@spences10
Copy link
Owner

Hey @rwasiak, yeah that's my mistake!

Feel free to submit a PR to correct or I can amend myself.

Thanks 🙏

@spences10
Copy link
Owner

Hey @rwasiak I've just tested this and it works as intended.

The logic is, if there's no date being passed to the component then it will substitute with the current date time.

Closing now, feel free to reopen with any suggestions you think would improve this.

Thanks.

@rwasiak
Copy link
Author

rwasiak commented Jun 20, 2020

Hey @spences10 - it is intended that for passing publishedDate or modifiedDate to SEO component you receive nulls?

Please look at this PR #87

PS - I can't reopen issue closed by someone else 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants