distill: Built blog posts display incorrect date (date-1) compared to slug and listing page
Hi All,
I’m creating this issue following a thread on community.rstudio.com with @cderv and @jthomasmock. Please let me know if I can help test anything or provide feedback otherwise! Thanks so much.
I’m seeing strange behavior where a built distill post displays the incorrect date compared to the url slug and the listing page. An example (github repo, published site):
I also see this when browsing other people’s published distill blogs, including those linked from https://pkgs.rstudio.com/distill/articles/examples.html, for example, https://blogs.rstudio.com/ai/posts/2021-02-11-tabnet/:
@cderv suspects that this is a timezone issue, because in France he sees the dates represented correctly. He says (I believe this is the url for “the code source”):
The code source of your page contains :
<script id="distill-front-matter" type="text/json">
{"title":"Interview with Dr. Dawn Wright","description":"Interview with Dr. Dawn Wright at MozFest","authors":[{"author":"Julie Lowndes & Erin Robinson","authorURL":"#","affiliation":" ","affiliationURL":"#","orcidID":""}],"publishedDate":"2021-03-08T00:00:00.000+00:00","citationText":"Robinson, 2021"}
</script>
Which is the data process by the JS from distill library. As you see the date contains the timezone part. So for me translated in CET it not the same day as for you I think.
@jthomasmock was also able to reproduce this behavior locally and created a gif showing that:
when changing the date of a post it will correctly adjust the “slug” but will do the date - 1 for the actual displayed date for the article.
Thanks for your help!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (1 by maintainers)
Commits related to this issue
- yayyyy testing https://github.com/rstudio/distill/issues/315#issuecomment-787798224 — committed to Openscapes/events by jules32 3 years ago
Awesome. This is merged now. So you can use Dev distill for this.
Hi @cderv – yes the issue is fixed for me now 🎉! It works locally as well as when published online.
Thank you so much, I really appreciate it. Distill is so awesome.
It seems there is something off with lubridate that makes thing goes crazy here:
Details
That is the only reason I see why this would not work. So I’ll revert and we still need to wait for a CRAN release of lubridate for this issue fixed. Thanks again @jules32
I’m getting the correct expected behavior now on a reprex-blog! Date indicated in the YAML gives the correct date in the blog-post description.
🤔 lubridate should have been updated and the error should be fine as your test above https://github.com/rstudio/distill/issues/315#issuecomment-778336323.
It is like lubridate issue is still there.
I’ll have a closer look.
You can now use dev version of distill and rebuild your posts.
So it means this is fixed. We can now revert the fix and depend on new lubridate. Will push a fix soon.
@jules32 the initial issue in distill was https://github.com/rstudio/distill/issues/207 It seems the underlying issue is fixed in last lubridate (https://github.com/tidyverse/lubridate/blob/master/NEWS.md#version-1792)
Can someone on Mac with R 4.0.3 and last CRAN lubridate version can try
Thanks.
Yes this is the exact issue I found in the investigation.
"2021-01-28T00:00:00.000+00:00"So this current fix cause every blogpost to show a wrong date when the UTC date is processed by JS distill script.
We had to put in a fix to workaround timezone issues in OS X / R 4.0.3. The fix was to force timezone to UTC, so this could indeed explain it. We expect to remove this fix once the underlying issues are addressed.
On Fri, Feb 12, 2021 at 10:53 AM Christophe Dervieux < notifications@github.com> wrote: