mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Add net5.0 target framework
This commit is contained in:

committed by
Patrik Svensson

parent
b1da5e7ba8
commit
380c6aca45
27
src/Spectre.Console/Extensions/DayOfWeekExtensions.cs
Normal file
27
src/Spectre.Console/Extensions/DayOfWeekExtensions.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Spectre.Console.Internal
|
||||
{
|
||||
internal static class DayOfWeekExtensions
|
||||
{
|
||||
public static string GetAbbreviatedDayName(this DayOfWeek day, CultureInfo culture)
|
||||
{
|
||||
culture ??= CultureInfo.InvariantCulture;
|
||||
return culture.DateTimeFormat
|
||||
.GetAbbreviatedDayName(day)
|
||||
.Capitalize(culture);
|
||||
}
|
||||
|
||||
public static DayOfWeek GetNextWeekDay(this DayOfWeek day)
|
||||
{
|
||||
var next = (int)day + 1;
|
||||
if (next > (int)DayOfWeek.Saturday)
|
||||
{
|
||||
return DayOfWeek.Sunday;
|
||||
}
|
||||
|
||||
return (DayOfWeek)next;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user