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

Ignore tz argument in as_date() #817

Merged
merged 6 commits into from
Dec 7, 2019
Merged

Ignore tz argument in as_date() #817

merged 6 commits into from
Dec 7, 2019

Conversation

hadley
Copy link
Member

@hadley hadley commented Nov 19, 2019

Fixes #674

R/coercion.r Outdated
@@ -670,10 +670,14 @@ setMethod(f = "as_date", signature = "numeric",
#' @export
setMethod("as_date", "character",
function(x, tz = NULL, format = NULL) {
if (!missing(tz)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer !is.null here instead. This one will get the warning even if the supplier passes NULL as an argument.

While unlikely in this case, the caller might want to have the same argument contracts as with as_date_time on some programatic occasions.

@vspinu vspinu merged commit e24c685 into master Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

character method for as_date forces tz arg when format present, doesn't use it
2 participants