Skip to content

Commit

Permalink
Added handling POSIXct and POSIXT datetypes to prep_match_datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
DemevengDerrick committed Apr 18, 2024
1 parent ff8f9a9 commit 399b1b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/prep_match_datatypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ prep_match_datatypes <- function(ref_dataframe, target_dataframe) {
target_dataframe <- target_dataframe |>
dplyr::mutate(!!col := as.logical(!!rlang::sym(col)))
} else if (col_type == "Date") {

target_dataframe <- target_dataframe |>
dplyr::mutate(!!col := as.Date(!!rlang::sym(col)
# format = "Y-%m-%d"
))
} else if (col_type == 'c("POSIXct", "POSIXt")') {
target_dataframe <- target_dataframe |>
dplyr::mutate(!!col == as.POSIXct(!!rlang::sym(col),
format = "YYYY-MM-DD"
))
}
}
Expand Down

0 comments on commit 399b1b9

Please sign in to comment.