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

Support seq for hms values #117

Open
AshesITR opened this issue May 24, 2023 · 0 comments
Open

Support seq for hms values #117

AshesITR opened this issue May 24, 2023 · 0 comments

Comments

@AshesITR
Copy link

It would be nice to be able to use seq() with hms values like this:

seq(hms::hms(hours = 8), hms::hms(hours = 19), by = hms::hms(minutes = 30))
#> Error in `/.difftime`(del, by): second argument of / cannot be a "difftime" object

Created on 2023-05-24 with reprex v2.0.2

An ugly workaround is this:

hms::as_hms(seq(as.numeric(hms::hms(hours = 8)), as.numeric(hms::hms(hours = 19)), by = as.numeric(hms::hms(minutes = 30))))
#> 08:00:00
#> 08:30:00
#> 09:00:00
#> 09:30:00
#> 10:00:00
#> 10:30:00
#> 11:00:00
#> 11:30:00
#> 12:00:00
#> 12:30:00
#> 13:00:00
#> 13:30:00
#> 14:00:00
#> 14:30:00
#> 15:00:00
#> 15:30:00
#> 16:00:00
#> 16:30:00
#> 17:00:00
#> 17:30:00
#> 18:00:00
#> 18:30:00
#> 19:00:00

Created on 2023-05-24 with reprex v2.0.2

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