Replace " UTC" and "-00" in all dates
To reflect Matomo and lubridate API changes (???)
Change-Id: I840fe1517b9aeb9fb8da9fd989cead1bdaca0a25
diff --git a/R/usercountry.R b/R/usercountry.R
index 9eb3638..0ea414c 100644
--- a/R/usercountry.R
+++ b/R/usercountry.R
@@ -6,6 +6,8 @@
#'
#' @inheritParams matomoQuery
#'
+#' @importFrom stringr str_replace str_replace_all
+#'
#' @examples
#' \dontrun{
#' df <- getUserCountry("https://demo.matomo.org/", siteId=3, period="day", date="last60")
@@ -22,7 +24,7 @@
matomoQuery(matomoUrl = matomoUrl,
siteId = siteId,
period = period,
- date = date,
+ date = str_replace_all(str_replace_all(date, " *UTC", ""), "-00", "-01"),
removeFirst = FALSE,
removeLast = FALSE,
accessToken = accessToken,