Example #1
0
 /// <summary>
 /// Get the day that the month starts. <br />
 /// 获得一个月开始的那一天。
 /// </summary>
 /// <param name="ld"></param>
 /// <returns></returns>
 public static LocalDate BeginningOfMonth(this LocalDate ld) => DateAdjusters.StartOfMonth(ld);
Example #2
0
 /// <summary>
 /// Set the month.<br />
 /// 设置月份。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="month"></param>
 /// <returns></returns>
 public static LocalDate SetMonth(this LocalDate ld, int month) =>
 DateAdjusters.Month(month)(ld);
Example #3
0
 /// <summary>
 /// Set the day.<br />
 /// 设置日期中的天。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="day"></param>
 /// <returns></returns>
 public static LocalDate SetDay(this LocalDate ld, int day) =>
 DateAdjusters.DayOfMonth(day)(ld);
Example #4
0
 /// <summary>
 /// Returns the previous date with the specified day-of-week, or the original date, if the day is already correct.<br/>
 /// 返回具有指定星期几的上一个日期,或者返回原始日期(如果该日期已经正确)。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="dayOfWeek"></param>
 /// <returns></returns>
 public static LocalDate PreviousOrSame(this LocalDate ld, IsoDayOfWeek dayOfWeek)
 {
     return(DateAdjusters.PreviousOrSame(dayOfWeek)(ld));
 }
Example #5
0
 /// <summary>
 /// Returns the previous date with the specified day-of-week.<br/>
 /// 返回具有指定星期几的上一个日期。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="dayOfWeek"></param>
 /// <returns></returns>
 public static LocalDate Previous(this LocalDate ld, DayOfWeek dayOfWeek)
 {
     return(DateAdjusters.Previous(dayOfWeek.AsIsoDayOfWeek())(ld));
 }
Example #6
0
 /// <summary>
 /// Returns the next date with the specified day-of-week, or the original date, if the day is already correct.<br/>
 /// 返回具有指定星期几的下一个日期,或者返回原始日期(如果该日期已经正确)。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="dayOfWeek"></param>
 /// <returns></returns>
 public static LocalDate NextOrSame(this LocalDate ld, IsoDayOfWeek dayOfWeek)
 {
     return(DateAdjusters.NextOrSame(dayOfWeek)(ld));
 }
Example #7
0
 /// <summary>
 /// Returns the next date with the specified day-of-week. <br/>
 /// 返回具有指定星期几的下一个日期。
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="dayOfWeek"></param>
 /// <returns></returns>
 public static LocalDate Next(this LocalDate ld, DayOfWeek dayOfWeek)
 {
     return(DateAdjusters.Next(dayOfWeek.AsIsoDayOfWeek())(ld));
 }
Example #8
0
 /// <summary>
 /// Get the last day of the month. <br />
 /// 获得一个月最后的那一天。
 /// </summary>
 /// <param name="ld"></param>
 /// <returns></returns>
 public static LocalDate EndOfMonth(this LocalDate ld) => DateAdjusters.EndOfMonth(ld);