Exemplo n.º 1
0
        protected override async Task OnInitializedAsync()
        {
            this.DateTimeNow      = DateTimeProvider.GetDateTimeNowDate();
            this.UsualShoppingDay = DayOfWeek.Sunday;

            await GenerateListFromDayOfWeek();
        }
Exemplo n.º 2
0
        private DateTime GetNextShoppingDay(DayOfWeek usualShoppingDay)
        {
            DateTime today = DateTimeProvider.GetDateTimeNowDate();
            int      daysUntilUsualShoppingDay = ((int)usualShoppingDay - (int)today.DayOfWeek + 7) % 7;
            DateTime nextShoppingDay           = today.AddDays(daysUntilUsualShoppingDay);

            return(nextShoppingDay);
        }