Skip to content

Commit 03b0e68

Browse files
committed
minor fixes
1 parent 4a33a37 commit 03b0e68

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All these methods return an instance of `IEnumerator<DateOnly>`.
3838
| dayOfMonth | The day of the month. Takes the last day of the month if `dayOfMonth` is more than the days in the month. |
3939
| dayOfYear | The day of the year. |
4040
| weekDays | Days of the week. |
41-
| numberOfWeek | Index of dayOfWeek in the month. |
41+
| indexOfDay | Index of dayOfWeek in the month. |
4242
| numberOfMonth | The number of the month. |
4343
| firstDayOfWeek | The first day of the week. |
4444

src/DateRecurrenceR/Collections/MonthlyEnumeratorLimitByCount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public void Dispose()
5555

5656
private static int GetMonthNumber(DateOnly date)
5757
{
58-
return 12 * date.Year + date.Month;
58+
return MonthsInYear * date.Year + date.Month;
5959
}
6060
}

src/DateRecurrenceR/Collections/MonthlyEnumeratorLimitByDate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public void Dispose()
5353

5454
private static int GetMonthNumber(DateOnly date)
5555
{
56-
return 12 * date.Year + date.Month;
56+
return MonthsInYear * date.Year + date.Month;
5757
}
5858
}

src/DateRecurrenceR/Core/MonthOfYear.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace DateRecurrenceR.Core;
1010
#endif
1111
{
1212
private const int MinVal = 1;
13-
private const int MaxVal = 12;
13+
private const int MaxVal = MonthsInYear;
1414

1515
private readonly int _value;
1616

src/DateRecurrenceR/Core/WeekDays.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public WeekDays(DayOfWeek day)
2525
/// </summary>
2626
/// <param name="day1"><see cref="DayOfWeek" /></param>
2727
/// <param name="day2"><see cref="DayOfWeek" /></param>
28-
2928
public WeekDays(DayOfWeek day1, DayOfWeek day2)
3029
: this(day1, day2, day2)
3130
{

src/DateRecurrenceR/Helpers/MonthlyRecurrenceHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ private static bool DateOutOfRangeByMonth(DateOnly beginDate, int addMonth)
3333

3434
private static int SubtractMonth(DateOnly minuendDate, DateOnly subtractedDate)
3535
{
36-
var minuend = minuendDate.Year * 12 + minuendDate.Month;
37-
var subtracted = subtractedDate.Year * 12 + subtractedDate.Month;
36+
var minuend = minuendDate.Year * MonthsInYear + minuendDate.Month;
37+
var subtracted = subtractedDate.Year * MonthsInYear + subtractedDate.Month;
3838

3939
return minuend - subtracted;
4040
}

src/DateRecurrenceR/Internals/Constant.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ namespace DateRecurrenceR.Internals;
33
internal struct Constant
44
{
55
public const int DaysInWeek = 7;
6+
public const int MonthsInYear = 12;
67
}

0 commit comments

Comments
 (0)