mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-17 13:10:28 +01:00
Adding the UI to the same repo. Made some default theme progress
This commit is contained in:
parent
d8c01ded6e
commit
119dfc3ac7
34
MediaBrowser.UI/Converters/DateTimeToStringConverter.cs
Normal file
34
MediaBrowser.UI/Converters/DateTimeToStringConverter.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace MediaBrowser.UI.Converters
|
||||
{
|
||||
public class DateTimeToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var date = (DateTime)value;
|
||||
|
||||
string format = parameter as string;
|
||||
|
||||
if (string.IsNullOrEmpty(format))
|
||||
{
|
||||
return date.ToString();
|
||||
}
|
||||
|
||||
if (format.Equals("shorttime", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return date.ToShortTimeString();
|
||||
}
|
||||
|
||||
return date.ToString(format);
|
||||
}
|
||||
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user