New: VIP Expiration notifications on Newznab

This commit is contained in:
Qstick
2021-03-06 16:24:38 -05:00
parent 6d9b028814
commit fa7647135b
4 changed files with 103 additions and 1 deletions
@@ -1,4 +1,4 @@
using System;
using System;
namespace NzbDrone.Common.Extensions
{
@@ -34,6 +34,20 @@ namespace NzbDrone.Common.Extensions
return dateTime >= afterDateTime;
}
public static bool IsValidDate(this string dateTime)
{
DateTime.TryParse(dateTime, out DateTime result);
return !result.Equals(default(DateTime));
}
public static bool IsFutureDate(this string dateTime)
{
DateTime.TryParse(dateTime, out DateTime result);
return !result.Equals(default(DateTime)) && result.After(DateTime.Now);
}
public static bool Between(this DateTime dateTime, DateTime afterDateTime, DateTime beforeDateTime)
{
return dateTime >= afterDateTime && dateTime <= beforeDateTime;