-
Notifications
You must be signed in to change notification settings - Fork 177
/
WesternCalendarPlus.cs
35 lines (31 loc) · 1.04 KB
/
WesternCalendarPlus.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Bot.Builder.Community.Dialogs.Luis.BuiltIn.DateTime;
namespace Bot.Builder.Community.Dialogs.Luis
{
/// <summary>
/// https://en.wikipedia.org/wiki/Gregorian_calendar
/// </summary>
public sealed class WesternCalendarPlus : ICalendarPlus
{
Calendar ICalendarPlus.Calendar => CultureInfo.InvariantCulture.Calendar;
DayOfWeek ICalendarPlus.FirstDayOfWeek => DayOfWeek.Sunday;
CalendarWeekRule ICalendarPlus.WeekRule => CalendarWeekRule.FirstDay;
int ICalendarPlus.HourFor(DayPart dayPart)
{
switch (dayPart)
{
case DayPart.MO: return 9;
case DayPart.MI: return 12;
case DayPart.AF: return 15;
case DayPart.EV: return 18;
case DayPart.NI: return 21;
default: throw new NotImplementedException();
}
}
}
}