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

Add LocalDateTimeRange #34

Open
antonkomarev opened this issue May 26, 2021 · 1 comment
Open

Add LocalDateTimeRange #34

antonkomarev opened this issue May 26, 2021 · 1 comment

Comments

@antonkomarev
Copy link

antonkomarev commented May 26, 2021

It will be useful to have LocalDateTimeRange to encapsulate start and end datetime. Quite similar to the LocalDateRange.

Otherwise we need to do something like this if we want to pass range as one parameter.

private function getRegistrationsBetweenDates(
    LocalDateRange $dateRange
): array {
    $registeredAtFrom = $dateRange->getStart()->atTime(LocalTime::min());
    $registeredAtTo = $dateRange->getEnd()->atTime(LocalTime::max());

    // ...
}

But this way we can only use 00:00:00 and 23:59:59 time.

Prososal:

private function getRegistrationsBetweenDateTimes(
    LocalDateTimeRange $dateTimeRange
): array {
    $registeredAtFrom = $dateTimeRange->getStart();
    $registeredAtTo = $dateTimeRange->getEnd();

    // ...
}
@gnutix
Copy link
Contributor

gnutix commented Jul 3, 2022

A comment worth referencing here : #45 (comment)

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

2 participants