Code Monkey home page Code Monkey logo

Comments (7)

yihui avatar yihui commented on August 19, 2024 2

blogdown doesn't parse the date; Hugo does. Hugo's documentation didn't seem to say what kind of date formats are accepted, but it seems to favor ISO (either 2017-01-07T00:00:00Z or 2017-01-07 is fine).

Given the endless pain with dealing with ambiguous date formats, personally I'd vote for ISO as the input format, too, and let users choose the display formats by themselves.

from distill.

jcolomb avatar jcolomb commented on August 19, 2024 1

Hi,

I back up Rao on this, the format you ask for is not scientific, not inclusive (USA only), and it will bring interoperability problems (blogdown requires iso formated dates, for instance).

So if you can change it, please do !

from distill.

jjallaire avatar jjallaire commented on August 19, 2024 1

Okay, so as things currently stand we can parse ISO dates. However, date output is controlled by Distill and always of the form Jan. 7, 2017

from distill.

cderv avatar cderv commented on August 19, 2024 1

I think this is now resolved and the date can be specified in the YAML field as YYYY-MM-DD.

from distill.

jjallaire avatar jjallaire commented on August 19, 2024

Yes, the tricky thing is that we'd need to try parsing the date a bunch of different ways. One further issue is that you really need to know in advance whether it's MM-DD or DD-MM (as otherwise you might transpose interpretation of days and months). As a result it's often better to require a specific format.

In terms of display output that's of course completely orthogonal so we could make that fix no matter what we do with input.

from distill.

RaoOfPhysics avatar RaoOfPhysics commented on August 19, 2024

Thanks for the prompt reply, @jjallaire!

[…] As a result it's often better to require a specific format.

In terms of display output that's of course completely orthogonal so we could make that fix no matter what we do with input.

Indeed, I was proposing that the specific format be YYYY-MM-DD. :) Perhaps the second option under date could allow the user to display it in the format of their choice. :)

I'm sure this will be some work for you, so please don't consider my request particularly high priority!

from distill.

jjallaire avatar jjallaire commented on August 19, 2024

@yihui What date format(s) do you parse from the date field in blogdown?

It looks like we already support parsing dates in ymd format via lubridate::ymd: https://github.com/rstudio/radix/blob/master/R/utils.R#L54-L63

In terms of display of dates, that's actually currently handled by Distill (the framework that Radix is based upon) but we could try to override what they are doing.

from distill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.