Beispiel #1
0
        public static IEnumerable <ZonedDateTime> FromDuration(ZonedDateTime start, ZonedDateTime end, Duration duration)
        {
            Ensure.Bool.IsTrue(start.ToInstant() < end.ToInstant());

            var range = new ZonedDateTimeRange(start, end);

            return(FromDuration(range, duration));
        }
Beispiel #2
0
        public static IEnumerable <ZonedDateTime> FromDuration(ZonedDateTimeRange range, Duration duration)
        {
            var c = range.Start;
            var e = range.End;

            while (ZonedDateTime.Comparer.Instant.Compare(c, e) < 0)
            {
                yield return(c);

                c = c.Plus(duration);
            }
        }
Beispiel #3
0
        public static IEnumerable <Instant> HourlyUtc(ZonedDateTimeRange range)
        {
            Instant c = range.Start.ToInstant();
            Instant e = range.End.ToInstant();

            while (c < e)
            {
                yield return(c);

                c = c.Plus(Duration.FromHours(1));
            }
        }
Beispiel #4
0
 public static IEnumerable <ZonedDateTime> Hourly(ZonedDateTimeRange range)
 {
     return(FromDuration(range, Duration.FromHours(1)));
 }