mirror of
https://github.com/4sval/FModel.git
synced 2026-12-05 07:42:19 -06:00
20 lines
639 B
C#
20 lines
639 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace FModel.Views.Resources.Converters;
|
|
|
|
public class DateTimeToStringConverter : IValueConverter
|
|
{
|
|
public static readonly DateTimeToStringConverter Instance = new();
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value is not DateTime dateTime ? value : $"{dateTime.ToLongDateString()}, {dateTime.ToShortTimeString()}";
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |