1
0
Fork 0
mirror of https://github.com/sensebox/opensensmapr synced 2025-02-23 07:53:58 +01:00
opensensmapR/R/api_utils.R

12 lines
355 B
R
Raw Normal View History

2017-08-10 18:01:09 +02:00
osem_remote_error = function (response) {
if (!is.null(response$code)) stop(response$message)
invisible(response)
}
date_as_isostring = function (date) {
# as_datetime is required so UTC times are always returned
# TODO: check if we can get along without lubridate dependency?
lubridate::as_datetime(date) %>% format.Date(format = '%FT%TZ')
}