Skip to content

Commit 442b6a7

Browse files
committed
add methods overloads; fix doc
1 parent 378b49f commit 442b6a7

File tree

9 files changed

+317
-32
lines changed

9 files changed

+317
-32
lines changed

src/DateRecurrenceR/Core/DayOfMonth.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public override int GetHashCode()
6060
return _value;
6161
}
6262

63-
/// <inheritdoc />
63+
/// <summary>
64+
/// Converts the numeric value of this instance to its equivalent string representation.
65+
/// </summary>
66+
/// <returns>The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9 with no leading zeroes.</returns>
6467
public override string ToString()
6568
{
6669
return _value.ToString();

src/DateRecurrenceR/Core/DayOfYear.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public override int GetHashCode()
6060
return _value;
6161
}
6262

63-
/// <inheritdoc />
63+
/// <summary>
64+
/// Converts the numeric value of this instance to its equivalent string representation.
65+
/// </summary>
66+
/// <returns>The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9 with no leading zeroes.</returns>
6467
public override string ToString()
6568
{
6669
return _value.ToString();

src/DateRecurrenceR/Core/Interval.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public override int GetHashCode()
6060
return _value;
6161
}
6262

63-
/// <inheritdoc />
63+
/// <summary>
64+
/// Converts the numeric value of this instance to its equivalent string representation.
65+
/// </summary>
66+
/// <returns>The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9 with no leading zeroes.</returns>
6467
public override string ToString()
6568
{
6669
return _value.ToString();

src/DateRecurrenceR/Core/MonthOfYear.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public override int GetHashCode()
6060
return _value;
6161
}
6262

63-
/// <inheritdoc />
63+
/// <summary>
64+
/// Converts the numeric value of this instance to its equivalent string representation.
65+
/// </summary>
66+
/// <returns>The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9 with no leading zeroes.</returns>
6467
public override string ToString()
6568
{
6669
return _value.ToString();

src/DateRecurrenceR/Recurrence.Daily.cs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ namespace DateRecurrenceR;
77
public partial struct Recurrence
88
{
99
/// <summary>
10-
/// Gets an enumerator for daily period for first <c>n</c> contiguous dates.
10+
/// Returns an enumerator for daily period for first <c>n</c> contiguous dates.
11+
/// </summary>
12+
/// <param name="beginDate">The date when the recurrence begins.</param>
13+
/// <param name="count">The maximum number of contiguous dates.</param>
14+
/// <param name="interval">The interval between occurrences.</param>
15+
/// <returns>
16+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
17+
/// </returns>
18+
public static IEnumerator<DateOnly> Daily(DateOnly beginDate, int count, Interval interval)
19+
{
20+
return Daily(beginDate, beginDate, count, interval);
21+
}
22+
23+
/// <summary>
24+
/// Returns an enumerator for daily period for first <c>n</c> contiguous dates.
1125
/// </summary>
1226
/// <param name="beginDate">The date when the recurrence begins.</param>
1327
/// <param name="fromDate">The date when a specific range starts.</param>
@@ -16,7 +30,6 @@ public partial struct Recurrence
1630
/// <returns>
1731
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
1832
/// </returns>
19-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
2033
public static IEnumerator<DateOnly> Daily(DateOnly beginDate,
2134
DateOnly fromDate,
2235
int count,
@@ -36,7 +49,22 @@ public static IEnumerator<DateOnly> Daily(DateOnly beginDate,
3649
}
3750

3851
/// <summary>
39-
/// Gets an enumerator for daily period in intersection ranges <c>[beginDate, endDate]</c> and
52+
/// Returns an enumerator for daily period in intersection ranges <c>[beginDate, endDate]</c> and
53+
/// <c>[fromDate, toDate]</c>.
54+
/// </summary>
55+
/// <param name="beginDate">The date when the recurrence begins.</param>
56+
/// <param name="endDate">The date when the recurrence ends.</param>
57+
/// <param name="interval">The interval between occurrences.</param>
58+
/// <returns>
59+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
60+
/// </returns>
61+
public static IEnumerator<DateOnly> Daily(DateOnly beginDate, DateOnly endDate, Interval interval)
62+
{
63+
return Daily(beginDate, endDate, beginDate, endDate, interval);
64+
}
65+
66+
/// <summary>
67+
/// Returns an enumerator for daily period in intersection ranges <c>[beginDate, endDate]</c> and
4068
/// <c>[fromDate, toDate]</c>.
4169
/// </summary>
4270
/// <param name="beginDate">The date when the recurrence begins.</param>
@@ -47,7 +75,6 @@ public static IEnumerator<DateOnly> Daily(DateOnly beginDate,
4775
/// <returns>
4876
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
4977
/// </returns>
50-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
5178
public static IEnumerator<DateOnly> Daily(DateOnly beginDate,
5279
DateOnly endDate,
5380
DateOnly fromDate,

src/DateRecurrenceR/Recurrence.Monthly.cs

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,26 @@ namespace DateRecurrenceR;
77
public partial struct Recurrence
88
{
99
/// <summary>
10-
/// Gets an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
10+
/// Returns an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
11+
/// <b>By day of month.</b>
12+
/// </summary>
13+
/// <param name="beginDate">The date when the recurrence begins.</param>
14+
/// <param name="count">The maximum number of contiguous dates.</param>
15+
/// <param name="dayOfMonth">
16+
/// The day of the month. Takes the last day of the month if <paramref name="dayOfMonth" /> is more than the days
17+
/// in the month.
18+
/// </param>
19+
/// <param name="interval">The interval between occurrences.</param>
20+
/// <returns>
21+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
22+
/// </returns>
23+
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate, int count, DayOfMonth dayOfMonth, Interval interval)
24+
{
25+
return Monthly(beginDate, beginDate, count, dayOfMonth, interval);
26+
}
27+
28+
/// <summary>
29+
/// Returns an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
1130
/// <b>By day of month.</b>
1231
/// </summary>
1332
/// <param name="beginDate">The date when the recurrence begins.</param>
@@ -21,7 +40,6 @@ public partial struct Recurrence
2140
/// <returns>
2241
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
2342
/// </returns>
24-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
2543
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
2644
DateOnly fromDate,
2745
int count,
@@ -48,7 +66,25 @@ DateOnly GetNextDate(int year, int month)
4866
}
4967

5068
/// <summary>
51-
/// Gets an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
69+
/// Returns an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
70+
/// <b>By day of week and number of week.</b>
71+
/// </summary>
72+
/// <param name="beginDate">The date when the recurrence begins.</param>
73+
/// <param name="count">The maximum number of contiguous dates.</param>
74+
/// <param name="dayOfWeek">The day of the week.</param>
75+
/// <param name="numberOfWeek">The number of the week. The first week of a month starts from the first day of the month.</param>
76+
/// <param name="interval">The interval between occurrences.</param>
77+
/// <returns>
78+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
79+
/// </returns>
80+
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate, int count, DayOfWeek dayOfWeek,
81+
NumberOfWeek numberOfWeek, Interval interval)
82+
{
83+
return Monthly(beginDate, beginDate, count, dayOfWeek, numberOfWeek, interval);
84+
}
85+
86+
/// <summary>
87+
/// Returns an enumerator for monthly period for first <c>n</c> contiguous dates.<br/>
5288
/// <b>By day of week and number of week.</b>
5389
/// </summary>
5490
/// <param name="beginDate">The date when the recurrence begins.</param>
@@ -60,7 +96,6 @@ DateOnly GetNextDate(int year, int month)
6096
/// <returns>
6197
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
6298
/// </returns>
63-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
6499
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
65100
DateOnly fromDate,
66101
int count,
@@ -87,7 +122,30 @@ DateOnly GetNextDate(int year, int month)
87122
}
88123

89124
/// <summary>
90-
/// Gets an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
125+
/// Returns an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
126+
/// <c>[fromDate, toDate]</c>.<br/>
127+
/// <b>By day of month.</b>
128+
/// </summary>
129+
/// <param name="beginDate">The date when the recurrence begins.</param>
130+
/// <param name="endDate">The date when the recurrence ends.</param>
131+
/// <param name="dayOfMonth">
132+
/// The day of the month. Takes the last day of the month if <paramref name="dayOfMonth" /> is more than the days
133+
/// in the month.
134+
/// </param>
135+
/// <param name="interval">The interval between occurrences.</param>
136+
/// <returns>
137+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
138+
/// </returns>
139+
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
140+
DateOnly endDate,
141+
DayOfMonth dayOfMonth,
142+
Interval interval)
143+
{
144+
return Monthly(beginDate, endDate, beginDate, endDate, dayOfMonth, interval);
145+
}
146+
147+
/// <summary>
148+
/// Returns an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
91149
/// <c>[fromDate, toDate]</c>.<br/>
92150
/// <b>By day of month.</b>
93151
/// </summary>
@@ -103,7 +161,6 @@ DateOnly GetNextDate(int year, int month)
103161
/// <returns>
104162
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
105163
/// </returns>
106-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
107164
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
108165
DateOnly endDate,
109166
DateOnly fromDate,
@@ -131,7 +188,29 @@ DateOnly GetNextDate(int year, int month)
131188
}
132189

133190
/// <summary>
134-
/// Gets an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
191+
/// Returns an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
192+
/// <c>[fromDate, toDate]</c>.<br/>
193+
/// <b>By day of week and number of week.</b>
194+
/// </summary>
195+
/// <param name="beginDate">The date when the recurrence begins.</param>
196+
/// <param name="endDate">The date when the recurrence ends.</param>
197+
/// <param name="dayOfWeek">The day of the week.</param>
198+
/// <param name="numberOfWeek">The number of the week. The first week of a month starts from the first day of the month.</param>
199+
/// <param name="interval">The interval between occurrences.</param>
200+
/// <returns>
201+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
202+
/// </returns>
203+
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
204+
DateOnly endDate,
205+
DayOfWeek dayOfWeek,
206+
NumberOfWeek numberOfWeek,
207+
Interval interval)
208+
{
209+
return Monthly(beginDate, endDate, beginDate, endDate, dayOfWeek, numberOfWeek, interval);
210+
}
211+
212+
/// <summary>
213+
/// Returns an enumerator for monthly period in intersection ranges <c>[beginDate, endDate]</c> and
135214
/// <c>[fromDate, toDate]</c>.<br/>
136215
/// <b>By day of week and number of week.</b>
137216
/// </summary>
@@ -145,7 +224,6 @@ DateOnly GetNextDate(int year, int month)
145224
/// <returns>
146225
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
147226
/// </returns>
148-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
149227
public static IEnumerator<DateOnly> Monthly(DateOnly beginDate,
150228
DateOnly endDate,
151229
DateOnly fromDate,

src/DateRecurrenceR/Recurrence.Weekly.cs

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,27 @@ namespace DateRecurrenceR;
77
public partial struct Recurrence
88
{
99
/// <summary>
10-
/// Gets an enumerator for weekly period for first <c>n</c> contiguous dates.
10+
/// Returns an enumerator for weekly period for first <c>n</c> contiguous dates.
11+
/// </summary>
12+
/// <param name="beginDate">The date when the recurrence begins.</param>
13+
/// <param name="count">The maximum number of contiguous dates.</param>
14+
/// <param name="weekDays">Days of the week.</param>
15+
/// <param name="firstDayOfWeek">The first day of the week.</param>
16+
/// <param name="interval">The interval between occurrences.</param>
17+
/// <returns>
18+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
19+
/// </returns>
20+
public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
21+
int count,
22+
WeekDays weekDays,
23+
DayOfWeek firstDayOfWeek,
24+
Interval interval)
25+
{
26+
return Weekly(beginDate, beginDate, count, weekDays, firstDayOfWeek, interval);
27+
}
28+
29+
/// <summary>
30+
/// Returns an enumerator for weekly period for first <c>n</c> contiguous dates.
1131
/// </summary>
1232
/// <param name="beginDate">The date when the recurrence begins.</param>
1333
/// <param name="fromDate">The date when a specific range starts.</param>
@@ -18,7 +38,6 @@ public partial struct Recurrence
1838
/// <returns>
1939
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
2040
/// </returns>
21-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
2241
public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
2342
DateOnly fromDate,
2443
int count,
@@ -43,7 +62,28 @@ public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
4362
}
4463

4564
/// <summary>
46-
/// Gets an enumerator for weekly period in intersection ranges <c>[beginDate, endDate]</c> and
65+
/// Returns an enumerator for weekly period in intersection ranges <c>[beginDate, endDate]</c> and
66+
/// <c>[fromDate, toDate]</c>.
67+
/// </summary>
68+
/// <param name="beginDate">The date when the recurrence begins.</param>
69+
/// <param name="endDate">The date when the recurrence ends.</param>
70+
/// <param name="weekDays">Days of the week.</param>
71+
/// <param name="firstDayOfWeek">The first day of the week.</param>
72+
/// <param name="interval">The interval between occurrences.</param>
73+
/// <returns>
74+
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
75+
/// </returns>
76+
public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
77+
DateOnly endDate,
78+
WeekDays weekDays,
79+
DayOfWeek firstDayOfWeek,
80+
Interval interval)
81+
{
82+
return Weekly(beginDate, endDate, beginDate, endDate, weekDays, firstDayOfWeek, interval);
83+
}
84+
85+
/// <summary>
86+
/// Returns an enumerator for weekly period in intersection ranges <c>[beginDate, endDate]</c> and
4787
/// <c>[fromDate, toDate]</c>.
4888
/// </summary>
4989
/// <param name="beginDate">The date when the recurrence begins.</param>
@@ -56,7 +96,6 @@ public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
5696
/// <returns>
5797
/// <see cref="IEnumerator{T}" /> type of <see cref="DateOnly" />
5898
/// </returns>
59-
/// <exception cref="ArgumentException">If <paramref name="interval" /> less than 1.</exception>
6099
public static IEnumerator<DateOnly> Weekly(DateOnly beginDate,
61100
DateOnly endDate,
62101
DateOnly fromDate,

0 commit comments

Comments
 (0)