/// <summary> /// Handles edge conditions when getting the Daily data when the current time is 12:00 AM. A day is subracted to handle that scenario /// </summary> private void ApplyDayOffset() { if (ReportedEndTime >= DateTime.UtcNow.AddHours(-HoursOffset)) { ReportedEndTime = ReportedEndTime.AddDays(-1); } }
public void PrepareReportedTimeFortheLastNoOfDays(int lastNoOfDays = 30) { ReportedEndTime = GetCurrentDateWithMidnightTime(); ReportedStartTime = ReportedEndTime.AddDays(-lastNoOfDays); ApplyDayOffset(); }