using System;

namespace SepehrFlightApiSampleClient.BuiltinTypeExtensions
{
    public static class StringExtension
    {
        public static T DeserializeFromJson<T>(this string input)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(input);
        }

        public static DateTime ParseFlightDate(this string date)
        {
            return DateTime.ParseExact(date, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        }
    }
}
