using Connected.Extensions; namespace Connected; public class IsoDateConverter : Converter { protected override string ConvertValue(DateTime value) => value.ToIsoDateString(); protected override DateTime ConvertValueBack(string? value) => DateTime.TryParse(value, out var dateTime) ? dateTime : DateTime.MinValue; } public class NullableIsoDateConverter : Converter { protected override string? ConvertValue(DateTime? value) => value?.ToIsoDateString(); protected override DateTime? ConvertValueBack(string? value) => DateTime.TryParse(value, out var dateTime) ? dateTime : null; }