Farbpalette vorladen lassen
Bootstraper läd jetzt die farbeinstellung sofort und nicht nachträglich cleanup and rework PDF switch to HTML export fix Colorsystem Farben für knöpfe hinzugefügt als anpassung button color button color primary and secondary change
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user