public static GetDefaultCalendarRule ( ) : CalendarWeekRule | ||
Résultat | CalendarWeekRule |
/// <summary> /// <para>Get the week number of a date</para> /// <para>Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule</para> /// <para>Use BaseDateTimeExtensions.GetDefaultFirstWeekDay() as first week day</para> /// </summary> /// <param name="date">Date to get week number</param> /// <returns>Week number or -1 when error</returns> public static int GetWeekNumber(this DateTime date) { return(date.GetWeekNumber(BaseDateTimeExtensions.GetDefaultCalendarRule(), BaseDateTimeExtensions.GetDefaultFirstWeekDay())); }
/// <summary> /// <para>Get the week number of a date</para> /// <para>Use BaseDateTimeExtensions.GetDefaultCalendarRule() as default calendar rule</para> /// </summary> /// <param name="date">Date to get week number</param> /// <param name="firstWeekDay">First day of week</param> /// <returns>Week number or -1 when error</returns> public static int GetWeekNumber(this DateTime date, DayOfWeek firstWeekDay) { return(date.GetWeekNumber(BaseDateTimeExtensions.GetDefaultCalendarRule(), firstWeekDay)); }