dragosmg commented on code in PR #13163:
URL: https://github.com/apache/arrow/pull/13163#discussion_r874990628
##########
r/R/dplyr-datetime-helpers.R:
##########
@@ -159,6 +159,27 @@ build_formats <- function(orders) {
orders <- gsub("[^A-Za-z_]", "", orders)
orders <- gsub("Y", "y", orders)
+ # we need a different logic in order to deal with "ym', "my", and "yq" orders
+ # we separate them from the rest of the `orders` vector and transform them.
+ # `ym` and `yq` become `ymd` & `my` becomes `myd`
+ # this is needed because strptime does not parse "2022-05", so we add "-01",
+ # thus changing the format, and for equivalence with lubridate, which parses
+ # `ym` to the first day of the month
Review Comment:
I'll have a look later and try to make it a bit more concise. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]