using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace detect.gui.Converters;

public class DateTimeConverter : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return ((DateTime?)value)?.ToString((string)parameter!);
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return value;
    }
}