Fixed lintr & complexity issues
This commit is contained in:
@@ -13,16 +13,20 @@ formatRangeDates <- function(start, end, min, max) {
|
||||
|
||||
dates <- parseDateTime(orig_dates)
|
||||
|
||||
if (length(dates$min) != 0
|
||||
start_before_min <- (
|
||||
length(dates$min) != 0
|
||||
&& length(dates$start) != 0
|
||||
&& lubridate::ymd(dates$start) < lubridate::ymd(dates$min)
|
||||
) {
|
||||
)
|
||||
if (start_before_min) {
|
||||
dates$start <- dates$min
|
||||
}
|
||||
if (length(dates$max) != 0
|
||||
end_after_max <- (
|
||||
length(dates$max) != 0
|
||||
&& length(dates$end) != 0
|
||||
&& lubridate::ymd(dates$end) > lubridate::ymd(dates$max)
|
||||
) {
|
||||
)
|
||||
if (end_after_max) {
|
||||
dates$end <- dates$max
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user