This commit is contained in:
2020-02-03 18:39:14 +00:00
parent 257063dd0f
commit a8a892d556
2 changed files with 19 additions and 2 deletions

View File

@@ -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;

View File

@@ -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