Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Commit 7e8bf23

Browse files
EgorBomarek-safar
authored andcommitted
fix ISOWeek for mcs
1 parent 0e5f123 commit 7e8bf23

File tree

1 file changed

+6
-2
lines changed
  • src/System.Private.CoreLib/shared/System/Globalization

1 file changed

+6
-2
lines changed

src/System.Private.CoreLib/shared/System/Globalization/ISOWeek.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ public static int GetWeeksInYear(int year)
8989
{
9090
throw new ArgumentOutOfRangeException(nameof(year), SR.ArgumentOutOfRange_Year);
9191
}
92-
93-
int P(int y) => (y + (y / 4) - (y / 100) + (y / 400)) % 7;
92+
#if __MonoCS__ // mcs doesn't support local funtions
93+
Func<int, int> P = y =>
94+
#else
95+
int P(int y) =>
96+
#endif
97+
(y + (y / 4) - (y / 100) + (y / 400)) % 7;
9498

9599
if (P(year) == 4 || P(year - 1) == 3)
96100
{

0 commit comments

Comments
 (0)