mirror of
https://github.com/4sval/FModel.git
synced 2026-04-27 16:47:20 -05:00
25 lines
648 B
C#
25 lines
648 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace FModel.Views.Resources.Converters;
|
|
|
|
public class DateTimeToDateConverter : IValueConverter
|
|
{
|
|
public static readonly DateTimeToDateConverter Instance = new();
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is DateTime dateTime)
|
|
{
|
|
return DateOnly.FromDateTime(dateTime);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|