From 7efa6d4f8a005ec47e680310d78520a424216e1d Mon Sep 17 00:00:00 2001 From: noerw Date: Wed, 23 Aug 2017 14:24:57 +0200 Subject: [PATCH] validate from/to order clientside --- R/measurement.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/measurement.R b/R/measurement.R index 20430bc..a74c9ec 100644 --- a/R/measurement.R +++ b/R/measurement.R @@ -113,10 +113,11 @@ parse_get_measurements_params = function (params) { if (!is.null(params$boxes)) query$boxIds = paste(params$boxes$X_id, collapse = ',') if (!is.null(params$bbox)) query$bbox = paste(params$bbox, collapse = ',') - if (!is.na(params$from)) - query$`from-date` = utc_date(params$from) %>% date_as_isostring() - if (!is.na(params$to)) - query$`to-date` = utc_date(params$to) %>% date_as_isostring() + if (!is.na(params$from) && !is.na(params$to)) { + dates = parse_dateparams(params$from, params$to) + query$`from-date` = dates[1] + query$`to-date` = dates[2] + } if (!is.na(params$exposure)) query$exposure = params$exposure if (!is.na(params$columns))