Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
        public void PrepareReportedTimeFortheLastNoOfDays(int lastNoOfDays = 30)
        {
            ReportedEndTime   = GetCurrentDateWithMidnightTime();
            ReportedStartTime = ReportedEndTime.AddDays(-lastNoOfDays);

            ApplyDayOffset();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles edge conditions when getting the Hourly data when the current time is 12:00 AM. A day is subracted to handle that scenario
        /// </summary>
        private void ApplyHourOffset()
        {
            if (ReportedEndTime >= DateTime.UtcNow.AddHours(-HoursOffset))
            {
                ReportedEndTime = ReportedEndTime.AddHours(-HoursOffset);
            }

            if (ReportedEndTime <= ReportedStartTime)
            {
                ReportedStartTime = ReportedStartTime.AddDays(-1)
                ;
            }
        }