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

Filter unavailable from signups #10

Open
jonthegeek opened this issue Oct 19, 2023 · 0 comments
Open

Filter unavailable from signups #10

jonthegeek opened this issue Oct 19, 2023 · 0 comments

Comments

@jonthegeek
Copy link
Member

In actual usage, whenever I read signups, I filter out unavailable times. Move that check into signups_read().

dplyr::filter(
  bookclubdata::signups_read(book_name, refresh = TRUE),
  !(datetime_utc %in% .unavailable_times()$unavailable_time)
)

.unavailable_times <- function() {
bookclubdata::active_clubs_times(TRUE) |>
    dplyr::transmute(
      date_utc = .make_utc(
        day = .data$day_utc,
        hour = .data$hour_utc,
        timezone = "UTC"
      ),
      next_hour = .data$date_utc + lubridate::hours(1),
      prev_hour = .data$date_utc - lubridate::hours(1)
    ) |>
    tidyr::pivot_longer(
      tidyr::everything(),
      values_to = "unavailable_time"
    ) |>
    dplyr::distinct(.data$unavailable_time) |>
    dplyr::arrange(.data$unavailable_time)

I'll need to formalize rules about the next hour/previous hour thing, so think out how multiple zoom accounts impacts things before blindly implementing this (and locking into an incorrect pattern).

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