2020-08-22 21:29:54 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2020-05-13 02:10:35 +00:00
|
|
|
using Jellyfin.Data.Enums;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2020-05-13 02:10:35 +00:00
|
|
|
namespace Jellyfin.Data
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
|
|
|
public static class DayOfWeekHelper
|
|
|
|
{
|
2021-03-09 04:57:38 +00:00
|
|
|
public static DayOfWeek[] GetDaysOfWeek(DynamicDayOfWeek day)
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
2021-03-09 04:57:38 +00:00
|
|
|
return day switch
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
2021-03-09 04:57:38 +00:00
|
|
|
DynamicDayOfWeek.Everyday => new[] { DayOfWeek.Sunday, DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday },
|
|
|
|
DynamicDayOfWeek.Weekday => new[] { DayOfWeek.Sunday, DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday },
|
|
|
|
DynamicDayOfWeek.Weekend => new[] { DayOfWeek.Saturday, DayOfWeek.Sunday },
|
|
|
|
_ => new[] { (DayOfWeek)day }
|
|
|
|
};
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|