Changed a few more DateTime constants; many more to go

This commit is contained in:
Rick Falkvinge
2017-01-16 01:45:40 +01:00
parent f09c202d94
commit c386aff65a
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ using Swarmops.Logic.Security;
using Swarmops.Logic.Structure;
using Swarmops.Logic.Support;
using System.IO;
using Swarmops.Common.ExtensionMethods;
namespace Swarmops.Logic.Swarm
{
@@ -58,7 +59,7 @@ namespace Swarmops.Logic.Swarm
{
if (base.Expires != value)
{
if (PersonId > 0 && OrganizationId > 0 && base.Expires != new DateTime (1900, 1, 1))
if (PersonId > 0 && OrganizationId > 0 && base.Expires.IsDefined())
{
ChurnData.LogRetention (PersonId, OrganizationId, base.Expires);
}
@@ -203,7 +204,7 @@ namespace Swarmops.Logic.Swarm
//Added LogChurn here to make SURE they always are logged with the membership.
if (PersonId > 0 && OrganizationId > 0 && base.Expires != new DateTime (1900, 1, 1))
if (PersonId > 0 && OrganizationId > 0 && base.Expires.IsDefined())
{
ChurnData.LogChurn (PersonId, OrganizationId);
}
+3 -3
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Globalization;
using Swarmops.Common.Enums;
using Swarmops.Common.ExtensionMethods;
using Swarmops.Common.Generics;
using Swarmops.Logic.Financial;
using Swarmops.Logic.Security;
@@ -160,9 +161,8 @@ namespace Swarmops.Frontend.Automation
if (assignments.Count > 0)
{
assignedName = assignments[0].Person.Canonical;
int expireYear = assignments[0].ExpiresDateTimeUtc.Year;
if (expireYear > 2000 && expireYear < 3000) // as in, "is defined"
{
if (assignments[0].ExpiresDateTimeUtc.IsDefined())
{
expires = assignments[0].ExpiresDateTimeUtc.ToString("yyyy-MMM-dd");
}
if (_assignable)