This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
@@ -280,6 +281,9 @@ namespace AyaNova.Biz
|
||||
|
||||
//So this is the core date time to work off of
|
||||
DateTime RelativeToday = DateTime.Today;
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FilterSqlCriteriaBuilder::DataFilterToColumnCriteria");
|
||||
log.LogInformation("RelativeToday (before adjustment):");
|
||||
log.LogInformation(RelativeToday.ToString());
|
||||
|
||||
|
||||
if (sValue.StartsWith("{[") && sValue.EndsWith("]}"))
|
||||
@@ -288,7 +292,15 @@ namespace AyaNova.Biz
|
||||
//Fetch useroptions object and relative time offset
|
||||
AyaNova.Models.AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext;
|
||||
var u = ct.User.AsNoTracking().Where(a => a.Id == userId).Select(m => new { tz = m.UserOptions.TimeZoneOffset }).First();
|
||||
RelativeToday=RelativeToday.AddHours((double)u.tz);
|
||||
RelativeToday = RelativeToday.AddHours((double)u.tz);
|
||||
|
||||
//TESTING:
|
||||
//LOG THE CRIT AND QUERY
|
||||
// ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FilterSqlCriteriaBuilder::DataFilterToColumnCriteria");
|
||||
log.LogInformation("RelativeToday (adjusted):");
|
||||
log.LogInformation(RelativeToday.ToString());
|
||||
log.LogInformation("Offset used:");
|
||||
log.LogInformation(u.tz.ToString());
|
||||
|
||||
#region Build criteria for date RANGE TOKEN specified
|
||||
//Used as the basis point
|
||||
@@ -421,7 +433,7 @@ namespace AyaNova.Biz
|
||||
|
||||
case FilterSpecialToken.NextMonth:
|
||||
//start with the first day of this month
|
||||
dtAfter = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, 00, 00, 00);
|
||||
dtAfter = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, RelativeToday.Hour, RelativeToday.Minute, 00);
|
||||
//Add a Month
|
||||
dtAfter = dtAfter.AddMonths(1);
|
||||
|
||||
@@ -430,7 +442,9 @@ namespace AyaNova.Biz
|
||||
|
||||
//case 1155
|
||||
dtAfter = dtAfter.AddSeconds(-1);
|
||||
|
||||
//TODO: REMOVE THIS TESTING
|
||||
//
|
||||
log.LogInformation($"NEXT MONTH TOKEN BUILDER IMMEDIATELY BEFORE BUILDING FRAGMENT: BEFORE={dtBefore.ToString()} AND AFTER={dtAfter.ToString()}");
|
||||
BuildBetweenTwoDatesFragment(sColumn, sb, dtAfter, dtBefore);
|
||||
break;
|
||||
case FilterSpecialToken.FourteenDayWindow:
|
||||
|
||||
@@ -189,6 +189,7 @@ namespace AyaNova.Biz
|
||||
q = q + FilterSqlCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, WidgetBiz.FilterOptions(), UserId);
|
||||
|
||||
//TESTING:
|
||||
//TODO: remove this from production build
|
||||
//LOG THE CRIT AND QUERY
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("WidgetBiz::GetManyAsync");
|
||||
log.LogInformation("Filter criteria:");
|
||||
|
||||
Reference in New Issue
Block a user