You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I personally think the date_style argument of the fmt_date() function is not very intuitive, since you have to input a number for the desired format and have to look up the meaning using another function (info_date_style()). Aside from non-human-readable syntax, it brings a great and undesirable need to have unnecessarily complicated documentation.
To improve convenience, I would suggest to allow human-readable formats. I was thinking of that one thing Excel is good at:
gt() %>%
fmt_date(date_style="ddd, dd mmmm yyyy")
An example of an implementation to transform e.g. "ddd, dd mmmm yyyy" to "%a, %d %B %Y" is available in the cleaner package: cleaner/R/format_datetime.R
I do feel that the fmt_date() et al. functions are quite limited in their simplicity. It would be great to revisit these formatters and allow for more precise ways of defining dates and times. Furthermore, the functions lack locale support, and that bothers me a lot (we can't get a formatted date/time in French, for example).
Note: a strftime() formatting option will be added to fmt_datetime() with a new argument. This issue will be associated with an ongoing PR that addresses fixed/enhances for the date/time formatters.
Activity
rich-iannone commentedon Apr 27, 2021
I do feel that the
fmt_date()et al. functions are quite limited in their simplicity. It would be great to revisit these formatters and allow for more precise ways of defining dates and times. Furthermore, the functions lack locale support, and that bothers me a lot (we can't get a formatted date/time in French, for example).rich-iannone commentedon Jun 19, 2021
Note: a
strftime()formatting option will be added tofmt_datetime()with a new argument. This issue will be associated with an ongoing PR that addresses fixed/enhances for the date/time formatters.