diff --git a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs index a865ffd3..63c0df5f 100644 --- a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs +++ b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs @@ -305,6 +305,23 @@ namespace AyaNova.DataList if (sValue.StartsWith("{[") && sValue.EndsWith("]}")) { + //BUGBUG: Ok, here's the issue: + //This test is run when my local time is winter time or "standard time" which is -8utc + //this test creates a future record for April which will be in DST or "daylight saving time" which is -7utc because it uses a library method to convert to universal time + //which takes into account the date. + //In other words, test code is using conversions based on DST PST effective of the created date falls on + + //At the server it's just blindly doing -8 because the user settings are at -8 + + //This means the server is filtering an april date using the forced -8 but the client is using the actual -7 so they are an hour out + //Fixes: + //Is it an issue? User is normally going to select specific dates and times regardless of time zone so this client code is actually a bit off when you think of it that way + //So test client should take into account user options setting rather than local date setting? + //Or, should server instead of having hard coded offset just have user's time zone and it in turn does the calcs properly + //so local users doesn't select an offset but rather a time zone and let .net handle all the conversions + //In future there won't be a daylight saving time in pacific time zone likely + + //Need to adjust RelativeToday to users time frame //Fetch useroptions object and relative time offset AyaNova.Models.AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext; diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 0e95bbe8..17a278dd 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -454,8 +454,8 @@ namespace AyaNova if (TESTING_REFRESH_DB) { AyaNova.Core.License.FetchKeyAsync(apiServerState, dbContext, _newLog).Wait(); - //NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time - Util.Seeder.SeedDatabaseAsync(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -7).Wait();//############################################################################################# + //NOTE: For unit testing make sure the time zone is same as tester to ensure list filter by date tests will work because server is on same page as user in terms of time + Util.Seeder.SeedDatabaseAsync(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -8).Wait();//############################################################################################# } //TESTING #endif