Exemple #1
0
        public static IEnumerable <LocalDate> FromPeriod(LocalDateRange range, Period period)
        {
            var c = range.Start;
            var e = range.End;

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

                c = c.Plus(period);
            }
        }
Exemple #2
0
        public static IEnumerable <LocalDate> Weekly(LocalDateRange range)
        {
            Ensure.Bool.IsTrue(range.Start.DayOfWeek == range.End.DayOfWeek);

            LocalDate c = range.Start;
            LocalDate e = range.End;

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

                c = c.PlusWeeks(1);
            }
        }
Exemple #3
0
        public static IEnumerable <LocalDate> Monthly(LocalDateRange range)
        {
            Ensure.Bool.IsTrue(range.Start.Day == 1);
            Ensure.Bool.IsTrue(range.End.Day == 1);

            LocalDate c = range.Start;
            LocalDate e = range.End;

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

                c = c.PlusMonths(1);
            }
        }
Exemple #4
0
        public static IEnumerable <LocalDate> Trimestraly(LocalDateRange range)
        {
            Ensure.Bool.IsTrue(range.Start.Day == 1);
            Ensure.Bool.IsTrue(range.End.Day == 1);
            Ensure.Bool.IsTrue(((range.Start.Month - 1) % 3) == 0);
            Ensure.Bool.IsTrue(((range.End.Month - 1) % 3) == 0);

            LocalDate c = range.Start;
            LocalDate e = range.End;

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

                c = c.PlusMonths(3);
            }
        }
Exemple #5
0
 public static IEnumerable <Instant> HourlyUtc(LocalDateRange range, string timezone)
 {
     return(HourlyUtc(range.InZone(timezone)));
 }
Exemple #6
0
 public static IEnumerable <LocalDateTime> HourlyLocal(LocalDateRange range)
 {
     return(HourlyLocal(range.ToLocalDateTimeRange()));
 }