parse_api_date: ParseApiDate

View source: R/ParseApiDate.R

parse_api_dateR Documentation

ParseApiDate

Description

Helper function to check if the date was input correctly before returning a url to be called by the GET function. Also returns an error if the API called can only provide data for a specific date-time, and not date only.

Usage

parse_api_date(api, input_date = "", summary)

Arguments

api

The api to be called, i.e. api = "environment/air-temperature"

input_date

Defaults to current (SGD) time. Format: YYYY-MM-DDTHH:MM:SS or YYYY-MM-DD

summary

Returns an error if the user inputs a date only time when not supported by the API.

Value

A url to be called by the API.


datagovsgR documentation built on Jan. 15, 2023, 5:07 p.m.