namespace HotMap.Utils; public static class UtilsExtensions { extension(DateOnly date) { public DateOnly GetMonday() { return date.DayOfWeek switch { DayOfWeek.Monday => date, DayOfWeek.Sunday => date.AddDays(-6), _ => date.AddDays(1 - (int)date.DayOfWeek) }; } } extension(IEnumerable enumerable) { public IEnumerable<(T, int)> WithIndex() { return enumerable.Select((v, i) => (v, i)); } } }