diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index 495ffe0a..e60890ec 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -2733,7 +2733,7 @@ namespace AyaNova.Util { DateTime seedStartWindow = DateTime.UtcNow.AddMonths(-3); DateTime seedEndWindow = DateTime.UtcNow.AddMonths(3); - bool isPast = false; + for (int x = 0; x < count; x++) { WorkOrder o = new WorkOrder(); @@ -2744,8 +2744,8 @@ namespace AyaNova.Util 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)); - if (woDate < DateTime.UtcNow) - isPast = true; + bool isPast = (woDate < DateTime.UtcNow); + 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.CompleteByDate = woDate.AddDays(5); // o.CustomerContactName = "contact name here";