Open srvanderplas opened 2 months ago
Thanks for the issue!
I'm handling the dates in Typsescript with the interpreter that ships with Quarto called Deno. I was very sad to learn that Deno does not include the libraries that resolve locales timezones into specific UTC offsets (which is a bummer because that's a great way to specify them!).
I'll keep this issue open to revisit when I have a moment to take another dive into the different ways this can be done to be sure I've exhausted the possibilities.
@andrewpbray I'm confused about the difficulty here. I would think that what needs to be done is to modify convertDateToISOFormat
to be more flexible in terms of input format but continue to return the ISO standard as the output.
It would try to determine the input format. Minimally this could distinguish {M,}M/{D,}D/YY
from ISO YYYY-MM-DD
. If the latter, it would return
${dateStr}T00:00:00${timezone};
, since the date part is already ISO standard.
Yes, you're totally right on the date formatting part. My comment was about locale approach so that it could do the right thing in terms of the offset during daylight savings times for locales that observe it.
It's possible that we can also take advantage of the datetime
library to do this processing without having to handwrite this stuff. I came across this the other day:
https://prerelease.quarto.org/docs/projects/scripts.html#deno-scripts
(Actually, i came upon this because I updated my local installation to the most recent version of Quarto and this change is the 1 breaking change to v1.6 and it breaks scheduled-docs
. I'll update this repo once 1.6 is released.)
Here's a proposal for the date formatting stuff:
yyyy-MM-dd
format for more generality.config.yml
(e.g., MM/dd/yyyy
) that is parsed via parse
from "https://deno.land/std@0.224.0/datetime/parse.ts".
parse("20-01-2019", "MM/dd/yyyy")
).parse
can handle MM/dd/yy
.@andrewpbray I'm happy to work on a PR if this seems like a good path forward.
That'd be great - PR welcomed!
This is in PR #14
Currently, scheduled-docs requires m/d/y format (or d/m/y format, I'm not sure). Allow for locale-specific date formats as well as ISO standard yyyy-mm-dd formats.