/// <summary> /// Initializes a new instance based on the specified <paramref name="year"/>, <paramref name="week"/> and <paramref name="offset"/>. /// </summary> /// <param name="year">The year.</param> /// <param name="week">The week number.</param> /// <param name="offset">The offset.</param> public EssentialsWeek(int year, int week, TimeSpan offset) { Week = week; Year = year; Start = TimeUtils.GetDateTimeOffsetFromIso8601Week(year, week, offset); End = Start.GetEndOfWeek(); }
/// <summary> /// Gets an instance of <see cref="EssentialsTime"/> representing the start of the specified <strong>ISO 8601</strong> <paramref name="week"/>. /// </summary> /// <param name="year">The <strong>ISO 8601</strong> year of the week.</param> /// <param name="week">The <strong>ISO 8601</strong> week number.</param> /// <param name="offset">The offset to convert the <see cref="EssentialsTime"/> value to.</param> /// <returns>An instance of <see cref="EssentialsTime"/>.</returns> public static EssentialsTime FromIso8601Week(int year, int week, TimeSpan offset) { return(new EssentialsTime(TimeUtils.GetDateTimeOffsetFromIso8601Week(year, week, offset))); }