Range thing.

This commit is contained in:
Burak Kaan Köse
2026-03-21 00:58:01 +01:00
parent 01f7a09cb7
commit 51fef043ee
45 changed files with 1327 additions and 3753 deletions
@@ -0,0 +1,24 @@
using System;
using System.Globalization;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Calendar;
public sealed class CalendarRangeTextFormatter : ICalendarRangeTextFormatter
{
public string Format(VisibleDateRange range, IDateContextProvider dateContextProvider)
{
var culture = dateContextProvider.Culture;
var startText = FormatDate(range.StartDate, culture);
if (range.DisplayType == CalendarDisplayType.Day)
{
return startText;
}
return $"{startText} - {FormatDate(range.EndDate, culture)}";
}
private static string FormatDate(DateOnly date, CultureInfo culture)
=> date.ToString(culture.DateTimeFormat.ShortDatePattern, culture);
}