Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different output in date/time formatters depending on input #800

Closed
rich-iannone opened this issue Jun 13, 2021 · 0 comments · Fixed by #801
Closed

Different output in date/time formatters depending on input #800

rich-iannone opened this issue Jun 13, 2021 · 0 comments · Fixed by #801

Comments

@rich-iannone
Copy link
Member

rich-iannone commented Jun 13, 2021

When using fmt_date() and associated functions, the output values are in some cases slightly different when specifying the styles as an index value or as the style name. The result is a sometimes accidental inclusion of a leading zeros in day values.

For example, the following produces an undesired leading zero:

dplyr::tibble(
  date = c("2015-01-01", "2015-02-15", "2015-03-25"),
) %>%
  gt() %>%
  fmt_date(
    columns = date,
    date_style = "day_m_year"
  )

formatted_date

whereas using the following does not:

dplyr::tibble(
  date = c("2015-01-01", "2015-02-15", "2015-03-25"),
) %>%
  gt() %>%
  fmt_date(
    columns = date,
    date_style = 7
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment