mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
work for #32
This commit is contained in:
parent
8bd0464bef
commit
acb39b56f8
13 changed files with 122 additions and 33 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace PlexRequests.Helpers
|
||||
|
@ -17,6 +18,21 @@ namespace PlexRequests.Helpers
|
|||
return new DateTimeOffset(newDate.Ticks, utcOffset);
|
||||
}
|
||||
|
||||
public static void CustomParse(string date, out DateTime dt)
|
||||
{
|
||||
// Try and parse it
|
||||
if (DateTime.TryParse(date, out dt))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Maybe it's only a year?
|
||||
if (DateTime.TryParseExact(date, "yyyy", CultureInfo.CurrentCulture, DateTimeStyles.None, out dt))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static TimeZoneInfo FindTimeZoneFromOffset(int minuteOffset)
|
||||
{
|
||||
var tzc = TimeZoneInfo.GetSystemTimeZones();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue