mirror of
https://github.com/jellyfin/jellyfin
synced 2024-09-05 23:53:44 +00:00
22 lines
780 B
C#
22 lines
780 B
C#
#pragma warning disable CS1591
|
|
|
|
using System;
|
|
using Jellyfin.Data.Enums;
|
|
|
|
namespace Jellyfin.Data
|
|
{
|
|
public static class DayOfWeekHelper
|
|
{
|
|
public static DayOfWeek[] GetDaysOfWeek(DynamicDayOfWeek day)
|
|
{
|
|
return day switch
|
|
{
|
|
DynamicDayOfWeek.Everyday => new[] { DayOfWeek.Sunday, DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday },
|
|
DynamicDayOfWeek.Weekday => new[] { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday },
|
|
DynamicDayOfWeek.Weekend => new[] { DayOfWeek.Sunday, DayOfWeek.Saturday },
|
|
_ => new[] { (DayOfWeek)day }
|
|
};
|
|
}
|
|
}
|
|
}
|