Skip to content

Commit 803a22b

Browse files
authored
Add ISO 8601 hint to Calendar.xml (#5075)
1 parent 7e69b7f commit 803a22b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xml/System.Globalization/Calendar.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,10 @@ Only the <xref:System.Globalization.JapaneseCalendar> and the <xref:System.Globa
23782378
- The <xref:System.Globalization.DateTimeFormatInfo.FirstDayOfWeek%2A?displayProperty=nameWithType> property contains the default first day of the week that can be used for the `firstDayOfWeek` parameter.
23792379
23802380
- The <xref:System.Globalization.DateTimeFormatInfo.CalendarWeekRule%2A?displayProperty=nameWithType> property contains the default calendar week rule that can be used for the `rule` parameter.
2381-
2381+
2382+
> [!NOTE]
2383+
> This does not map exactly to ISO 8601. The differences are discussed in the blog entry [ISO 8601 Week of Year format in Microsoft .NET](https://go.microsoft.com/fwlink/?LinkId=160851). Starting with .NET Core 3.0, <xref:System.Globalization.ISOWeek.GetYear%2A?displayProperty=nameWithType> and <xref:System.Globalization.ISOWeek.GetWeekOfYear%2A?displayProperty=nameWithType> solve this problem.
2384+
23822385
The following example uses the current culture's <xref:System.Globalization.DateTimeFormatInfo> object to determine that January 1, 2011 is in the first week of the year in the Gregorian calendar.
23832386
23842387
[!code-csharp[System.Globalization.Calendar.GetWeekOfYear#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/getweekofyearex1.cs#2)]

0 commit comments

Comments
 (0)