/// <summary> /// Gets an instance of <see cref="DateTime"/> representing the date <strong>Memorial Day</strong>. /// Memorial Day is a federal holiday in the United States for remembering the people who died while /// serving in the country's armed forces. The holiday is observed every year on the last Monday of May. /// </summary> /// <param name="year">The year.</param> /// <returns>An instance of <see cref="DateTime"/> representing the date of <strong>Memorial Day</strong>.</returns> /// <see> /// <cref>https://en.wikipedia.org/wiki/Memorial_Day</cref> /// </see> public static DateTime GetMemorialDay(int year) { return(TimeUtils.GetFirstWeekdayOfMonth(year, EssentialsDateMonthName.May, DayOfWeek.Monday)); }
/// <summary> /// Gets an instance of <see cref="DateTime"/> representing the date of <strong>Thanksgiving Day</strong>. /// Thanksgiving, or Thanksgiving Day, is an important public holiday, celebrated on the fourth Thursday in /// November in the United States. It originated as a harvest festival. Thanksgiving has been celebrated /// nationally on and off since 1789, after a proclamation by George Washington. /// </summary> /// <param name="year">The year.</param> /// <returns>An instance of <see cref="DateTime"/> representing the date of /// <strong>Thanksgiving Day</strong>.</returns> /// <see> /// <cref>https://en.wikipedia.org/wiki/Thanksgiving_(United_States)</cref> /// </see> public static DateTime GetThanksgivingDay(int year) { return(TimeUtils.GetFirstWeekdayOfMonth(year, EssentialsDateMonthName.November, DayOfWeek.Thursday).AddDays(7 * 3)); }
/// <summary> /// Gets an instance of <see cref="DateTime"/> representing the date of <strong>Labor Day</strong>. Labor /// Day is a public holiday celebrated on the first Monday in September. /// </summary> /// <param name="year">The year.</param> /// <returns>A an instance of <see cref="DateTime"/> representing the date of <strong>Patriot Day</strong>.</returns> /// <see> /// <cref>https://en.wikipedia.org/wiki/Labor_Day</cref> /// </see> public static DateTime GetLaborDay(int year) { return(TimeUtils.GetFirstWeekdayOfMonth(year, EssentialsDateMonthName.September, DayOfWeek.Monday)); }
/// <summary> /// Gets the first day of the month that matches <paramref name="dayOfWeek"/>. /// </summary> /// <param name="year">The year.</param> /// <param name="month">The month.</param> /// <param name="dayOfWeek">The weekday to match.</param> /// <param name="offset">The time's offset from Coordinated Universal Time (UTC).</param> /// <returns>An instance of <see cref="DateTimeOffset"/> representing the day.</returns> public static DateTimeOffset GetFirstWeekdayOfMonth(int year, int month, DayOfWeek dayOfWeek, TimeSpan offset) { return(TimeUtils.GetFirstWeekdayOfMonth(year, month, dayOfWeek, offset)); }
/// <summary> /// Gets the first day of the month that matches <paramref name="dayOfWeek"/>. /// </summary> /// <param name="year">The year.</param> /// <param name="month">The month.</param> /// <param name="dayOfWeek">The weekday to match.</param> /// <returns>An instance of <see cref="DateTime"/> representing the day.</returns> public static DateTime GetFirstWeekdayOfMonth(int year, int month, DayOfWeek dayOfWeek) { return(TimeUtils.GetFirstWeekdayOfMonth(year, month, dayOfWeek)); }
/// <summary> /// Gets the first day of the month that matches <paramref name="dayOfWeek"/>. /// </summary> /// <param name="year">The year.</param> /// <param name="month">The month.</param> /// <param name="dayOfWeek">The weekday to match.</param> /// <returns>An instance of <see cref="DateTime"/> representing the day.</returns> public static DateTime GetFirstWeekdayOfMonth(int year, EssentialsDateMonthName month, DayOfWeek dayOfWeek) { return(TimeUtils.GetFirstWeekdayOfMonth(year, month, dayOfWeek)); }
/// <summary> /// Gets the first day of the month that matches <paramref name="dayOfWeek"/>. /// </summary> /// <param name="date">A date in the month.</param> /// <param name="dayOfWeek">The weekday to match.</param> /// <returns>An instance of <see cref="DateTimeOffset"/> representing the day.</returns> public static DateTimeOffset GetFirstWeekdayOfMonth(DateTimeOffset date, DayOfWeek dayOfWeek) { return(TimeUtils.GetFirstWeekdayOfMonth(date, dayOfWeek)); }