using System.Globalization; namespace cfs_tracker.Helpers; public static class DateHelper { public static readonly CultureInfo GermanCulture = new("de-DE"); public static DateTime StartOfWeekMonday(DateTime date) { var normalized = date.Date; var diff = (7 + (normalized.DayOfWeek - DayOfWeek.Monday)) % 7; return normalized.AddDays(-diff); } public static string ToGermanDateText(DateTime date) => date.ToString("dddd, dd. MMMM yyyy", GermanCulture); public static string ToGermanShortDay(DateTime date) => date.ToString("ddd dd.MM.", GermanCulture); public static string ToGermanMonthYear(DateTime date) => date.ToString("MMMM yyyy", GermanCulture); public static string ToGermanYear(DateTime date) => date.ToString("yyyy", GermanCulture); }