mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Use file scoped namespace declarations
This commit is contained in:

committed by
Phil Scott

parent
1dbaf50935
commit
ec1188b837
@ -1,27 +1,26 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Spectre.Console
|
||||
namespace Spectre.Console;
|
||||
|
||||
internal static class DayOfWeekExtensions
|
||||
{
|
||||
internal static class DayOfWeekExtensions
|
||||
public static string GetAbbreviatedDayName(this DayOfWeek day, CultureInfo culture)
|
||||
{
|
||||
public static string GetAbbreviatedDayName(this DayOfWeek day, CultureInfo culture)
|
||||
{
|
||||
culture ??= CultureInfo.InvariantCulture;
|
||||
return culture.DateTimeFormat
|
||||
.GetAbbreviatedDayName(day)
|
||||
.CapitalizeFirstLetter(culture);
|
||||
}
|
||||
|
||||
public static DayOfWeek GetNextWeekDay(this DayOfWeek day)
|
||||
{
|
||||
var next = (int)day + 1;
|
||||
if (next > (int)DayOfWeek.Saturday)
|
||||
{
|
||||
return DayOfWeek.Sunday;
|
||||
}
|
||||
|
||||
return (DayOfWeek)next;
|
||||
}
|
||||
culture ??= CultureInfo.InvariantCulture;
|
||||
return culture.DateTimeFormat
|
||||
.GetAbbreviatedDayName(day)
|
||||
.CapitalizeFirstLetter(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