Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@ganevru, I am experiencing the same described here: #25
This tiny PR isn't the most elegant one, but it does prevent the issue from happening. (Since this is my first PR here, I decided to go as simple as possible.)
A solution to consider in the future (depending on your plans) is to add a timeZone option in
siteMetadata
(gatsby-config.js
) and then parse it appropriately insidedate.js
.The root cause of the issue is that in our frontmatters (as per the starters examples) we input dates in the following format:
When you insert that string into the
Date
constructor,Date
objects are (implicitly) created with 00:00:00 time and UTC as their time zone:Then, when you convert the
newDate
usingtoLocaleString(language, options)
to our local time zones, things can get weird.Because @reallymello (Florida) and I live in time zones that are UTC-3 (or more) we noticed the issue. All our posts/notes/links are showed in the feed with the frontmatter day minus 1.
I assume you haven't noticed anything on your side because it seems you live in Moscow (which is UTC+3, give or take). Your days are never shifted!
Well, that's a very long explanation for such a tiny PR. 😅
In any case, thanks again for creating this great theme!