diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-27 19:33:15 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-27 19:33:15 +0300 |
| commit | e571f20e27c4fca6bb6efe03d6427a1f332f9830 (patch) | |
| tree | b16041b76ea3b4e8368039c9396f9bbf9624dcc2 /Software/Visual_Studio/Tango.SharedUI | |
| parent | 157e0685abb2e7b22b6584cdc7d6f5838ed0a808 (diff) | |
| download | Tango-e571f20e27c4fca6bb6efe03d6427a1f332f9830.tar.gz Tango-e571f20e27c4fca6bb6efe03d6427a1f332f9830.zip | |
Working on panel pc.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToShortDateConverter.cs | 31 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToShortDateConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToShortDateConverter.cs new file mode 100644 index 000000000..b8f4666cf --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToShortDateConverter.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class DateTimeUTCToShortDateConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + DateTime date = (DateTime)value; + return date.ToLocalTime().ToShortDateString(); + } + else + { + return null; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 1f05d3ed6..35b9a61e4 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -84,6 +84,7 @@ <Compile Include="Converters\ColorComponentToOpacityConverter.cs" /> <Compile Include="Converters\ColorToComponentsConverter.cs" /> <Compile Include="Converters\ColorToIntegerConverter.cs" /> + <Compile Include="Converters\DateTimeUTCToShortDateConverter.cs" /> <Compile Include="Converters\DateTimeUTCToShortDateTimeConverter.cs" /> <Compile Include="Converters\DateTimeUTCToStringConverter.cs" /> <Compile Include="Converters\DoubleToIntConverter.cs" /> |
