just started testing with new .net core v6 fixed some minor issues with UTC dates in light of new npgsql thing

This commit is contained in:
2021-10-15 23:31:28 +00:00
parent 1e27ec2366
commit 95d2ac89b7
6 changed files with 73 additions and 69 deletions

View File

@@ -1925,7 +1925,7 @@ namespace AyaNova.Util
//HeadOffice contacts
await SeedUserAsync(log, 1, AuthorizationRoles.Customer, UserType.HeadOffice, true, null, null, 0, null, null, null, NewObject.Id);
//HeadOffice Customer
await SeedCustomerAsync(log, 2,slevel, NewObject.Id);
await SeedCustomerAsync(log, 2, slevel, NewObject.Id);
}
}
@@ -2749,7 +2749,7 @@ namespace AyaNova.Util
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
var tempDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
var tempHour = Fake.Random.Int(9, 17);//9am to 5 pm (except some times may be in different dst state so this will be out by an hour for example depending on time of year and time zone in question)
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0, DateTimeKind.Utc));
bool isPast = (woDate.Subtract(DateTime.UtcNow).TotalDays < -7);
o.CreatedDate = woDate > DateTime.UtcNow ? DateTime.UtcNow : woDate;//no created dates in future but want a range of past dates to show off age of wo
@@ -3296,7 +3296,7 @@ namespace AyaNova.Util
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
var tempDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
var tempHour = Fake.Random.Int(9, 17);//9am to 5 pm (except some times may be in different dst state so this will be out by an hour for example depending on time of year and time zone in question)
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0, DateTimeKind.Utc));
o.CreatedDate = woDate > DateTime.UtcNow ? DateTime.UtcNow : woDate;//no created dates in future but want a range of past dates to show off age of wo
o.Requested = woDate.AddDays(-2);
@@ -3712,7 +3712,7 @@ namespace AyaNova.Util
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
var tempDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
var tempHour = Fake.Random.Int(9, 17);//9am to 5 pm (except some times may be in different dst state so this will be out by an hour for example depending on time of year and time zone in question)
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0, DateTimeKind.Utc));
o.CreatedDate = DateTime.UtcNow;