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

GetUpcomingDays does also return current day #15

Open
bjarnef opened this issue Dec 6, 2016 · 2 comments
Open

GetUpcomingDays does also return current day #15

bjarnef opened this issue Dec 6, 2016 · 2 comments

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Dec 6, 2016

I would expect the method GetUpcomingDays to return upcoming days exclusive today. E.g. today Tuesday, I would expect GetUpcomingDays(7) to return the upcoming seven days, but not inclusive today.

@{
    OpeningHoursModel openingHours = Model.Content.GetOpeningHours();

    var upcomingDays = openingHours.GetUpcomingDays(7);

    <h3>Åbningstider</h3>

    foreach (var day in upcomingDays)
    {
        <strong>@day.WeekDayName</strong><br />
        @day.WeekDay<br />
        @day.Weekday<br /><br />
    }
}

image

image

@abjerner
Copy link
Member

abjerner commented Dec 6, 2016

I think the idea was that if you're to list the opening hours of the upcoming days, you might want to display the opening hours of the present day as well (eg. watching the opening hours in the morning, the opening hours of the present day is still useful information).

If you can think of a better name, I'd be happy to change it. An alternative could be to implement a method for both scenarios - with and without the present day.

@bjarnef
Copy link
Contributor Author

bjarnef commented Dec 6, 2016

Ahh okay.. maybe then an overload of the method to include current day or an optional parameter, where the second parameter is a boolean. If true it also includes current day. By default I think this should be false.

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