From 7f878c01a4f6402e4efbd5c74a3610416b3fa8ee Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Sat, 27 Apr 2024 18:52:17 +0100 Subject: [PATCH 1/8] trying to use TZID property to set tz --- R/ic_dataframe.R | 17 ++++++++++++----- R/ic_date.R | 8 ++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/R/ic_dataframe.R b/R/ic_dataframe.R index e874f7d..d4c18b8 100644 --- a/R/ic_dataframe.R +++ b/R/ic_dataframe.R @@ -38,13 +38,20 @@ ic_dataframe <- function(x) { if(any(date_cols)) { x_df[date_cols] <- lapply(x_df[, date_cols], ic_date) } - datetime_cols <- names(x_df) %in% c("DTSTART", "DTEND") - if(any(datetime_cols)) { - x_df[datetime_cols] <- lapply(x_df[, datetime_cols], ic_datetime) - } - # names(x_df) <- gsub(pattern = ".VALUE.DATE", replacement = "", names(x_df)) + datetime_cols <- names(x_df) %in% grep("^DT.*", names(x_df), value = TRUE) # include any column starting with DT + tz_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name + col_timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull tz from col names + if(any(datetime_cols)) { + if (any(tz_cols)) { + x_df[, tz_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[, tz_cols], col_timezones) # apply timezones to tz_cols + # x_df[, datetime_cols & !tz_cols] <- lapply(x_df[, datetime_cols & !tz_cols], ic_datetime) # set time zone on columns with TZID to local + } else { + x_df[datetime_cols] <- lapply(x_df[, datetime_cols], ic_datetime) + } + } + #names(x_df) <- gsub(pattern = ";TZID.*", replacement = "", names(x_df)) x_df } diff --git a/R/ic_date.R b/R/ic_date.R index 7814202..81f3de0 100644 --- a/R/ic_date.R +++ b/R/ic_date.R @@ -7,7 +7,7 @@ #' @examples #' ic_datetime("20180809T160000Z") #' ic_date("20120103") -ic_datetime <- function(x) { +ic_datetime <- function(x, ...) { # TODO (LH): regex check x timestamp if(any(!is.na(x) & !(x == "NA") & !grepl("^\\d{8}T\\d{6}Z?$", x))) { @@ -18,13 +18,13 @@ ic_datetime <- function(x) { plain <- gsub("[TZtz]", "", x) - # if time string has a trailing "Z" assign to zulu timezone + # if time string has a trailing "Z" assign to zulu timezone if (any(grepl("Z$", x))) { datetime <- as.POSIXct(plain, tz = "Zulu", format = "%Y%m%d%H%M%S") - attr(datetime, "tzone") <- "" # change tz to "" which defaults to local system timezone; this could be left out if not desired + attr(datetime, "tzone") <- "" # change tz to "" which defaults to local system timezone; this could be left out if not desired # but as.POSIXct() uses tz = "" as standard argument and this is what is used below if not zulu time } else { - datetime <- as.POSIXct(plain, format = "%Y%m%d%H%M%S") + datetime <- as.POSIXct(plain, format = "%Y%m%d%H%M%S", tz = ...) } datetime } From 92cf9bb100f2581821cf25d1b20b3d5346993837 Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Sun, 28 Apr 2024 14:47:44 +0100 Subject: [PATCH 2/8] almost got TZID conversion working; still throwing warning line 49 ic_dataframe() --- R/ic_dataframe.R | 15 ++++++++------- R/ic_date.R | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/R/ic_dataframe.R b/R/ic_dataframe.R index d4c18b8..698aef2 100644 --- a/R/ic_dataframe.R +++ b/R/ic_dataframe.R @@ -35,23 +35,24 @@ ic_dataframe <- function(x) { x_df <- ic_bind_list(x_list_named) date_cols <- grepl(pattern = "VALUE=DATE", x = names(x_df)) + datetime_cols <- names(x_df) %in% grep("^DT[A-Z]+$", names(x_df), value = TRUE) # include any column starting with DT + tz_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name + timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull tz from col names + if(any(date_cols)) { x_df[date_cols] <- lapply(x_df[, date_cols], ic_date) } - datetime_cols <- names(x_df) %in% grep("^DT.*", names(x_df), value = TRUE) # include any column starting with DT - tz_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name - col_timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull tz from col names - if(any(datetime_cols)) { if (any(tz_cols)) { - x_df[, tz_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[, tz_cols], col_timezones) # apply timezones to tz_cols - # x_df[, datetime_cols & !tz_cols] <- lapply(x_df[, datetime_cols & !tz_cols], ic_datetime) # set time zone on columns with TZID to local + x_df[, tz_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[, tz_cols], timezones) # apply timezones to tz_cols + x_df[, datetime_cols & !tz_cols] <- lapply(x_df[, datetime_cols & !tz_cols], ic_datetime) # set time zone on columns without TZID to local } else { x_df[datetime_cols] <- lapply(x_df[, datetime_cols], ic_datetime) } } - #names(x_df) <- gsub(pattern = ";TZID.*", replacement = "", names(x_df)) + names(x_df) <- gsub(pattern = ";VALUE=DATE", replacement = "", names(x_df)) + names(x_df) <- gsub(pattern = ";TZID.*", replacement = "", names(x_df)) x_df } diff --git a/R/ic_date.R b/R/ic_date.R index 81f3de0..387f423 100644 --- a/R/ic_date.R +++ b/R/ic_date.R @@ -7,7 +7,7 @@ #' @examples #' ic_datetime("20180809T160000Z") #' ic_date("20120103") -ic_datetime <- function(x, ...) { +ic_datetime <- function(x, tzone = "") { # TODO (LH): regex check x timestamp if(any(!is.na(x) & !(x == "NA") & !grepl("^\\d{8}T\\d{6}Z?$", x))) { @@ -24,7 +24,7 @@ ic_datetime <- function(x, ...) { attr(datetime, "tzone") <- "" # change tz to "" which defaults to local system timezone; this could be left out if not desired # but as.POSIXct() uses tz = "" as standard argument and this is what is used below if not zulu time } else { - datetime <- as.POSIXct(plain, format = "%Y%m%d%H%M%S", tz = ...) + datetime <- as.POSIXct(plain, tz = tzone, format = "%Y%m%d%H%M%S") } datetime } From b5e4e119d55385ed0df5454a426d8119d656e01a Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 00:33:31 +0100 Subject: [PATCH 3/8] added setting time zone if TZID property present; added testthat to check working --- R/ic_dataframe.R | 15 ++++++------ R/ic_date.R | 2 +- inst/extdata/apple_calendar_test.ics | 36 ++++++++++++++++++++++++++++ tests/testthat/test-ic_datetime.R | 7 ++++++ 4 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 inst/extdata/apple_calendar_test.ics diff --git a/R/ic_dataframe.R b/R/ic_dataframe.R index 698aef2..a4f3c7f 100644 --- a/R/ic_dataframe.R +++ b/R/ic_dataframe.R @@ -19,6 +19,7 @@ ic_dataframe <- function(x) { if(methods::is(object = x, class2 = "data.frame")) { return(x) + } stopifnot(methods::is(object = x, class2 = "character") | methods::is(object = x, class2 = "list")) @@ -35,20 +36,20 @@ ic_dataframe <- function(x) { x_df <- ic_bind_list(x_list_named) date_cols <- grepl(pattern = "VALUE=DATE", x = names(x_df)) - datetime_cols <- names(x_df) %in% grep("^DT[A-Z]+$", names(x_df), value = TRUE) # include any column starting with DT - tz_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name + datetime_cols <- names(x_df) %in% grep("^DT[A-Z]+$|CREATED|LAST-MODIFIED", names(x_df), value = TRUE) # include any column starting with DT + tzid_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull tz from col names if(any(date_cols)) { - x_df[date_cols] <- lapply(x_df[, date_cols], ic_date) + x_df[date_cols] <- lapply(x_df[date_cols], ic_date) } if(any(datetime_cols)) { - if (any(tz_cols)) { - x_df[, tz_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[, tz_cols], timezones) # apply timezones to tz_cols - x_df[, datetime_cols & !tz_cols] <- lapply(x_df[, datetime_cols & !tz_cols], ic_datetime) # set time zone on columns without TZID to local + if (any(tzid_cols)) { + x_df[tzid_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[tzid_cols], timezones) # apply timezones to tzid_cols + x_df[datetime_cols & !tzid_cols] <- lapply(x_df[datetime_cols & !tzid_cols], ic_datetime) # set time zone on datetime cols without TZID to local } else { - x_df[datetime_cols] <- lapply(x_df[, datetime_cols], ic_datetime) + x_df[datetime_cols] <- lapply(x_df[datetime_cols], ic_datetime) } } names(x_df) <- gsub(pattern = ";VALUE=DATE", replacement = "", names(x_df)) diff --git a/R/ic_date.R b/R/ic_date.R index 387f423..03e48d9 100644 --- a/R/ic_date.R +++ b/R/ic_date.R @@ -7,7 +7,7 @@ #' @examples #' ic_datetime("20180809T160000Z") #' ic_date("20120103") -ic_datetime <- function(x, tzone = "") { +ic_datetime <- function(x, tzone = "") { # allow pass through of time zone to as.POSIXct # TODO (LH): regex check x timestamp if(any(!is.na(x) & !(x == "NA") & !grepl("^\\d{8}T\\d{6}Z?$", x))) { diff --git a/inst/extdata/apple_calendar_test.ics b/inst/extdata/apple_calendar_test.ics new file mode 100644 index 0000000..e5573a1 --- /dev/null +++ b/inst/extdata/apple_calendar_test.ics @@ -0,0 +1,36 @@ +BEGIN:VCALENDAR +CALSCALE:GREGORIAN +PRODID:-//Apple Inc.//macOS 13.4.1//EN +VERSION:2.0 +X-WR-CALNAME:Test +BEGIN:VTIMEZONE +TZID:Europe/London +BEGIN:DAYLIGHT +DTSTART:19810329T010000 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU +TZNAME:BST +TZOFFSETFROM:+0000 +TZOFFSETTO:+0100 +END:DAYLIGHT +BEGIN:STANDARD +DTSTART:19961027T020000 +RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU +TZNAME:GMT +TZOFFSETFROM:+0100 +TZOFFSETTO:+0000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CREATED:20230320T213321Z +DESCRIPTION:Testing : 00:00\n +DTEND;TZID=Europe/London:20230630T160000 +DTSTAMP:20230709T221931Z +DTSTART;TZID=Europe/London:20230630T120000 +LAST-MODIFIED:20230320T213321Z +LOCATION:London +SEQUENCE:0 +SUMMARY:This is test data +TRANSP:OPAQUE +UID:5C15BDCE-C77A-4A67-BBD3-8D5AD233A034 +END:VEVENT +END:VCALENDAR diff --git a/tests/testthat/test-ic_datetime.R b/tests/testthat/test-ic_datetime.R index b59b67a..9863582 100644 --- a/tests/testthat/test-ic_datetime.R +++ b/tests/testthat/test-ic_datetime.R @@ -13,3 +13,10 @@ test_that("ic_datetime works for 20180809T160000Z:", { test_that("ic_datetime is NA for empty:", { expect_output(ic_datetime(""), NA) }) + +test_that("DTSTART & DTEND time zones equal TZID property", { + f <- system.file("extdata", "apple_calendar_test.ics", package = "calendar") + ics_df = ic_read(f) + expect_equal(attributes(ics_df$DTSTART)$tzone, "Europe/London") + expect_equal(attributes(ics_df$DTEND)$tzone, "Europe/London") +}) From b1ca05944872ad9703c419887e88e04f654b5fdd Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 00:45:58 +0100 Subject: [PATCH 4/8] switched test time zone to "Pacific/Auckland" as different to local time zone --- inst/extdata/apple_calendar_test.ics | 4 ++-- tests/testthat/test-ic_datetime.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/extdata/apple_calendar_test.ics b/inst/extdata/apple_calendar_test.ics index e5573a1..ca69420 100644 --- a/inst/extdata/apple_calendar_test.ics +++ b/inst/extdata/apple_calendar_test.ics @@ -23,9 +23,9 @@ END:VTIMEZONE BEGIN:VEVENT CREATED:20230320T213321Z DESCRIPTION:Testing : 00:00\n -DTEND;TZID=Europe/London:20230630T160000 +DTEND;TZID=Pacific/Auckland:20230630T160000 DTSTAMP:20230709T221931Z -DTSTART;TZID=Europe/London:20230630T120000 +DTSTART;TZID=Pacific/Auckland:20230630T120000 LAST-MODIFIED:20230320T213321Z LOCATION:London SEQUENCE:0 diff --git a/tests/testthat/test-ic_datetime.R b/tests/testthat/test-ic_datetime.R index 9863582..8fde019 100644 --- a/tests/testthat/test-ic_datetime.R +++ b/tests/testthat/test-ic_datetime.R @@ -17,6 +17,6 @@ test_that("ic_datetime is NA for empty:", { test_that("DTSTART & DTEND time zones equal TZID property", { f <- system.file("extdata", "apple_calendar_test.ics", package = "calendar") ics_df = ic_read(f) - expect_equal(attributes(ics_df$DTSTART)$tzone, "Europe/London") - expect_equal(attributes(ics_df$DTEND)$tzone, "Europe/London") + expect_equal(attributes(ics_df$DTSTART)$tzone, "Pacific/Auckland") # "Pacific/Auckland" chosen as different to testers local time zone + expect_equal(attributes(ics_df$DTEND)$tzone, "Pacific/Auckland") }) From c71b2c57d0bb4a2e2c3eb46c7260382432f16f0e Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 11:00:48 +0100 Subject: [PATCH 5/8] added comment in ic_dataframe.R about pulling each time zone from each event TZID property --- R/ic_dataframe.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/ic_dataframe.R b/R/ic_dataframe.R index a4f3c7f..b39ffb4 100644 --- a/R/ic_dataframe.R +++ b/R/ic_dataframe.R @@ -38,7 +38,9 @@ ic_dataframe <- function(x) { date_cols <- grepl(pattern = "VALUE=DATE", x = names(x_df)) datetime_cols <- names(x_df) %in% grep("^DT[A-Z]+$|CREATED|LAST-MODIFIED", names(x_df), value = TRUE) # include any column starting with DT tzid_cols <- names(x_df) %in% grep(".*TZID=.*", names(x_df), value = TRUE) # find cols with TZID in name - timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull tz from col names + timezones <- unlist(regmatches(names(x_df), gregexpr("(?<=TZID=).*", names(x_df), perl = TRUE))) # pull all tzones from col names into vector to apply separately to each column + # in case different events have differing tzones although + # think most calendar software only uses single tzone if(any(date_cols)) { x_df[date_cols] <- lapply(x_df[date_cols], ic_date) From d19cd31df6c1c8f6c01ad59f16e34bbd09fe7b7e Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 21:29:05 +0100 Subject: [PATCH 6/8] change TZID cols to local time zone; changed test_that to be "" local time zone --- R/ic_dataframe.R | 3 ++- tests/testthat/test-ic_datetime.R | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/R/ic_dataframe.R b/R/ic_dataframe.R index b39ffb4..02b301d 100644 --- a/R/ic_dataframe.R +++ b/R/ic_dataframe.R @@ -49,7 +49,8 @@ ic_dataframe <- function(x) { if(any(datetime_cols)) { if (any(tzid_cols)) { x_df[tzid_cols] <- Map(function(x, y) ic_datetime(x, tzone = y), x_df[tzid_cols], timezones) # apply timezones to tzid_cols - x_df[datetime_cols & !tzid_cols] <- lapply(x_df[datetime_cols & !tzid_cols], ic_datetime) # set time zone on datetime cols without TZID to local + x_df[tzid_cols] <- lapply(x_df[tzid_cols], function(x) {attr(x, "tzone") <- ""; x}) # change tzid_cols to local time zone + x_df[datetime_cols & !tzid_cols] <- lapply(x_df[datetime_cols & !tzid_cols], ic_datetime) # set time zone on datetime cols without TZID to local ic_datetime() does this by default } else { x_df[datetime_cols] <- lapply(x_df[datetime_cols], ic_datetime) } diff --git a/tests/testthat/test-ic_datetime.R b/tests/testthat/test-ic_datetime.R index 8fde019..25d6cd9 100644 --- a/tests/testthat/test-ic_datetime.R +++ b/tests/testthat/test-ic_datetime.R @@ -14,9 +14,9 @@ test_that("ic_datetime is NA for empty:", { expect_output(ic_datetime(""), NA) }) -test_that("DTSTART & DTEND time zones equal TZID property", { - f <- system.file("extdata", "apple_calendar_test.ics", package = "calendar") +test_that("DTSTART & DTEND time zones equal local time zone ''", { + f <- system.file("extdata", "apple_calendar_test.ics", package = "calendar") # "Pacific/Auckland" chosen as original time zone as different to testers local time zone ics_df = ic_read(f) - expect_equal(attributes(ics_df$DTSTART)$tzone, "Pacific/Auckland") # "Pacific/Auckland" chosen as different to testers local time zone - expect_equal(attributes(ics_df$DTEND)$tzone, "Pacific/Auckland") + expect_equal(attributes(ics_df$DTSTART)$tzone, "") + expect_equal(attributes(ics_df$DTEND)$tzone, "") }) From e957b38837bfed96028fc122b2e3b79a60aa5b40 Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 22:44:17 +0100 Subject: [PATCH 7/8] added to tzone param to roxygen documentation --- R/ic_date.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/ic_date.R b/R/ic_date.R index 03e48d9..f192389 100644 --- a/R/ic_date.R +++ b/R/ic_date.R @@ -1,8 +1,12 @@ #' Convert ical datetime into R datetime +#' +#' Convert ical datetime into R datetime #' Z at the end of an ical stamp stands of Zulu time #' https://en.wikipedia.org/wiki/Coordinated_Universal_Time#Time_zones #' which is UTC = GMT https://greenwichmeantime.com/info/zulu/ #' @inheritParams ic_find +#' @param tzone a character string. Time zone specification to be used for the conversion if datetime not Zulu time. +#' Defaults to `""` which is the current local system time zone. See \link[OlsonNames]{OlsonNames} for list of time zones. #' @export #' @examples #' ic_datetime("20180809T160000Z") From 00c75900443106b6085ca6fa424f9e80d349e739 Mon Sep 17 00:00:00 2001 From: Ollie Lloyd Date: Tue, 30 Apr 2024 23:45:51 +0100 Subject: [PATCH 8/8] ongoing error in documentation example --- DESCRIPTION | 2 +- R/ic_date.R | 9 +++++---- man/calendar.Rd | 25 +++++++++++++++++++++++++ man/ic_attributes_vec.Rd | 4 ++-- man/ic_datetime.Rd | 16 ++++++++-------- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6b31f66..035c3aa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,4 +43,4 @@ VignetteBuilder: Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.1 diff --git a/R/ic_date.R b/R/ic_date.R index f192389..f8fab81 100644 --- a/R/ic_date.R +++ b/R/ic_date.R @@ -1,12 +1,13 @@ #' Convert ical datetime into R datetime #' -#' Convert ical datetime into R datetime -#' Z at the end of an ical stamp stands of Zulu time +#' @description +#' Convert ical datetime into R datetime. Z at the end of an ical stamp stands of Zulu time +#' #' https://en.wikipedia.org/wiki/Coordinated_Universal_Time#Time_zones -#' which is UTC = GMT https://greenwichmeantime.com/info/zulu/ +#' which is UTC = GMT https://greenwichmeantime.com/articles/history/zulu/ #' @inheritParams ic_find #' @param tzone a character string. Time zone specification to be used for the conversion if datetime not Zulu time. -#' Defaults to `""` which is the current local system time zone. See \link[OlsonNames]{OlsonNames} for list of time zones. +#' Defaults to `""` which is the current local system time zone. See \link[base]{OlsonNames} for list of time zones. #' @export #' @examples #' ic_datetime("20180809T160000Z") diff --git a/man/calendar.Rd b/man/calendar.Rd index c0512d4..7312a90 100644 --- a/man/calendar.Rd +++ b/man/calendar.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/package.R \docType{package} \name{calendar} +\alias{calendar-package} \alias{calendar} \title{ics files with R} \description{ @@ -12,3 +13,27 @@ Files adhering to this standard are save as \code{.ics} files. \details{ The \code{ical} package is for interacting with such files } +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/atfutures/calendar} + \item \url{https://atfutures.github.io/calendar/} + \item \url{https://github.com/ATFutures/calendar} + \item Report bugs at \url{https://github.com/ATFutures/calendar/issues} +} + +} +\author{ +\strong{Maintainer}: Robin Lovelace \email{rob00x@gmail.com} (\href{https://orcid.org/0000-0001-5679-6536}{ORCID}) + +Authors: +\itemize{ + \item Layik Hama \email{layik.hama@gmail.com} (\href{https://orcid.org/0000-0003-1912-4890}{ORCID}) +} + +Other contributors: +\itemize{ + \item Ollie Lloyd \email{o.lloyd@doctors.org.uk} (\href{https://orcid.org/0000-0002-9385-1634}{ORCID}) [contributor] +} + +} diff --git a/man/ic_attributes_vec.Rd b/man/ic_attributes_vec.Rd index 280b626..ba1612b 100644 --- a/man/ic_attributes_vec.Rd +++ b/man/ic_attributes_vec.Rd @@ -6,8 +6,8 @@ \usage{ ic_attributes_vec( x = NULL, - ic_attributes = c(BEGIN = "VCALENDAR", PRODID = "ATFutures/calendar", VERSION = - "2.0", CALSCALE = "GREGORIAN", METHOD = "PUBLISH") + ic_attributes = c(BEGIN = "VCALENDAR", PRODID = "ATFutures/calendar", VERSION = "2.0", + CALSCALE = "GREGORIAN", METHOD = "PUBLISH") ) } \arguments{ diff --git a/man/ic_datetime.Rd b/man/ic_datetime.Rd index f69ece5..999973e 100644 --- a/man/ic_datetime.Rd +++ b/man/ic_datetime.Rd @@ -2,21 +2,21 @@ % Please edit documentation in R/ic_date.R \name{ic_datetime} \alias{ic_datetime} -\title{Convert ical datetime into R datetime -Z at the end of an ical stamp stands of Zulu time -https://en.wikipedia.org/wiki/Coordinated_Universal_Time#Time_zones -which is UTC = GMT https://greenwichmeantime.com/info/zulu/} +\title{Convert ical datetime into R datetime} \usage{ -ic_datetime(x) +ic_datetime(x, tzone = "") } \arguments{ \item{x}{Lines read-in in from an iCal file} + +\item{tzone}{a character string. Time zone specification to be used for the conversion if datetime not Zulu time. +Defaults to \code{""} which is the current local system time zone. See \link[base]{OlsonNames} for list of time zones.} } \description{ -Convert ical datetime into R datetime -Z at the end of an ical stamp stands of Zulu time +Convert ical datetime into R datetime. Z at the end of an ical stamp stands of Zulu time + https://en.wikipedia.org/wiki/Coordinated_Universal_Time#Time_zones -which is UTC = GMT https://greenwichmeantime.com/info/zulu/ +which is UTC = GMT https://greenwichmeantime.com/articles/history/zulu/ } \examples{ ic_datetime("20180809T160000Z")