Use file scoped namespace declarations

This commit is contained in:
Patrik Svensson
2021-12-21 11:06:46 +01:00
committed by Phil Scott
parent 1dbaf50935
commit ec1188b837
607 changed files with 28739 additions and 29245 deletions

View File

@ -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;
}
}