-
Notifications
You must be signed in to change notification settings - Fork 218
Bug fixes and enhancements to date/time formatters #801
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
Conversation
* master: Add padding options for heading and column labels (#795)
krlmlr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a very quick look. My biggest question here is: why does gt need to be concerned with parsing date/time/datetime values from strings? How bad would it be if gt accepted only properly typed data? Perhaps we could support two code paths, one for character input (legacy, using existing code) and one for typed input (without support for parsing)?
| date_style %in% as.character(date_format_num_range) | ||
| ) { | ||
| date_style <- as.numeric(date_style) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: An else if here and below makes the purpose of these three blocks a bit clearer.
| } | |
| } else if ... |
| call. = FALSE | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } else if ... |
| time_style %in% as.character(time_format_num_range) | ||
| ) { | ||
| time_style <- as.numeric(time_style) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } else if ... |
| call. = FALSE | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } else if ... |
R/utils.R
Outdated
|
|
||
| has_dt_tz <- function(x) { | ||
|
|
||
| grepl(".+(Z|z|(\\+|-)[0-9]{2}([:]?[0-9]{2})?)?$", "2020-04-21T13:04:58.321Z") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used?
| grepl(".+(Z|z|(\\+|-)[0-9]{2}([:]?[0-9]{2})?)?$", "2020-04-21T13:04:58.321Z") | |
| grepl(".+(Z|z|(\\+|-)[0-9]{2}([:]?[0-9]{2})?)?$", x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now corrected. Currently it isn't used (should be removed before merging if never used).
* master: Fixes to footer (footnotes and source notes) across all output formats (#864) Row group labels as a column in stub (#855) Use reusable GHA workflows (#847) Increment version number v0.3.1 Release Candidate (#821) Fix for styles applied to summary cells when row groups are reordered (#814) Update image generation functions (#803) `cell_text()` fix (#805) Add whitespace options for text (#797)
…o date-time-fmt-fix
* master: Bug fixes and enhancements to date/time formatters (#801)
* master: Add ability to set global locale in `gt()` (#866) Bug fixes and enhancements to date/time formatters (#801) Fixes to footer (footnotes and source notes) across all output formats (#864) Row group labels as a column in stub (#855) Use reusable GHA workflows (#847) Increment version number v0.3.1 Release Candidate (#821)
* master: (23 commits) Improve color handling and add tests (#870) Change HTML percent sign to literal `%` (#871) Add ability to set global locale in `gt()` (#866) Bug fixes and enhancements to date/time formatters (#801) Update gt_workflow_diagram.svg Update gt_parts_of_a_table.svg Update README.md Add dedicated ISSUE TEMPLATEs Update README.md Delete README.Rmd Update intro-creating-gt-tables.Rmd Update LICENSE Make corrections to docs (`columns`/`rows`) Update _pkgdown.yml Fixes to footer (footnotes and source notes) across all output formats (#864) Row group labels as a column in stub (#855) Use reusable GHA workflows (#847) Increment version number v0.3.1 Release Candidate (#821) Fix for styles applied to summary cells when row groups are reordered (#814) ...
This PR provides a bugfix, more flexibility, improved documentation, and more testing for the date/time formatting functions (
fmt_date(),fmt_time(), andfmt_datetime()). NowDateandPOSIXctcolumns are allowed to be formatted with these functions.Fixes: #775
Fixes: #800
Fixes: #612