You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/Jellyfin.Data/DayOfWeekHelper.cs

66 lines
1.9 KiB

using System;
6 years ago
using System.Collections.Generic;
using Jellyfin.Data.Enums;
6 years ago
namespace Jellyfin.Data
6 years ago
{
public static class DayOfWeekHelper
{
public static List<DayOfWeek> GetDaysOfWeek(DynamicDayOfWeek day)
{
var days = new List<DayOfWeek>(7);
6 years ago
if (day == DynamicDayOfWeek.Sunday
|| day == DynamicDayOfWeek.Weekend
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Sunday);
6 years ago
}
if (day == DynamicDayOfWeek.Monday
|| day == DynamicDayOfWeek.Weekday
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Monday);
6 years ago
}
if (day == DynamicDayOfWeek.Tuesday
|| day == DynamicDayOfWeek.Weekday
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Tuesday);
6 years ago
}
if (day == DynamicDayOfWeek.Wednesday
|| day == DynamicDayOfWeek.Weekday
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Wednesday);
6 years ago
}
if (day == DynamicDayOfWeek.Thursday
|| day == DynamicDayOfWeek.Weekday
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Thursday);
6 years ago
}
if (day == DynamicDayOfWeek.Friday
|| day == DynamicDayOfWeek.Weekday
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Friday);
6 years ago
}
if (day == DynamicDayOfWeek.Saturday
|| day == DynamicDayOfWeek.Weekend
|| day == DynamicDayOfWeek.Everyday)
6 years ago
{
days.Add(DayOfWeek.Saturday);
6 years ago
}
return days;
6 years ago
}
}
}