Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert dates to strings (and back again) #12

Open
richierocks opened this issue Jun 13, 2019 · 0 comments
Open

Convert dates to strings (and back again) #12

richierocks opened this issue Jun 13, 2019 · 0 comments

Comments

@richierocks
Copy link
Contributor

Date fields need to be converted to strings before they can be sent to Asana or they cause an error. For example:

library(asana)
library(dcasana)
library(dplyr)

team_content_quality_gid <- dc_get_teams() %>%
  filter(name == "Content Quality") %>%
  pull(gid)

test_project <- asn_projects_create_in_team(
  team = team_content_quality_gid,
  name = "test-autogenerated-project",
  notes = "This is a test. Please delete this project."
)
test_task <- asn_tasks_create(
  projects = test_project$content$data$gid,
  name = 'Test Task 1',
  due_on = Sys.Date() + 1
)
#> Error in curl::handle_setform(handle, .list = req$fields): Unsupported value type for form field 'due_on'.

Ideally, all dates should automatically be converted to strings (using format()), rather than the user having to manually do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant