Class DateAdjusters
Inheritance
DateAdjusters
Assembly: NodaTime.dll
Syntax
public static class DateAdjusters
Properties
EndOfMonth
A date adjuster to move to the last day of the current month.
Declaration
public static Func<LocalDate, LocalDate> EndOfMonth { get; }
Property Value
Type |
Description |
Func<LocalDate, LocalDate> |
A date adjuster to move to the last day of the current month.
(The value returned is never null.) |
StartOfMonth
A date adjuster to move to the first day of the current month.
Declaration
public static Func<LocalDate, LocalDate> StartOfMonth { get; }
Property Value
Type |
Description |
Func<LocalDate, LocalDate> |
A date adjuster to move to the first day of the current month.
(The value returned is never null.) |
Methods
DayOfMonth(Int32)
A date adjuster to move to the specified day of the current month.
Declaration
public static Func<LocalDate, LocalDate> DayOfMonth(int day)
Parameters
Type |
Name |
Description |
Int32 |
day |
The day of month to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which changes the day to day ,
retaining the same year and month. (The value returned is never null.) |
Month(Int32)
A date adjuster to move to the same day of the specified month.
Declaration
public static Func<LocalDate, LocalDate> Month(int month)
Parameters
Type |
Name |
Description |
Int32 |
month |
The month to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which changes the month to month ,
retaining the same year and day of month. (The value returned is never null.) |
Next(IsoDayOfWeek)
A date adjuster to move to the next specified day-of-week, adding
a week if the day is already correct.
Declaration
public static Func<LocalDate, LocalDate> Next(IsoDayOfWeek dayOfWeek)
Parameters
Type |
Name |
Description |
IsoDayOfWeek |
dayOfWeek |
The day-of-week to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which advances a date to the next occurrence of the
specified day-of-week. (The value returned is never null.) |
NextOrSame(IsoDayOfWeek)
A date adjuster to move to the next specified day-of-week, but return the
original date if the day is already correct.
Declaration
public static Func<LocalDate, LocalDate> NextOrSame(IsoDayOfWeek dayOfWeek)
Parameters
Type |
Name |
Description |
IsoDayOfWeek |
dayOfWeek |
The day-of-week to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which advances a date to the next occurrence of the
specified day-of-week, or the original date if the day is already corret. (The value returned is never null.) |
Previous(IsoDayOfWeek)
A date adjuster to move to the previous specified day-of-week, subtracting
a week if the day is already correct.
Declaration
public static Func<LocalDate, LocalDate> Previous(IsoDayOfWeek dayOfWeek)
Parameters
Type |
Name |
Description |
IsoDayOfWeek |
dayOfWeek |
The day-of-week to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which advances a date to the previous occurrence of the
specified day-of-week. (The value returned is never null.) |
PreviousOrSame(IsoDayOfWeek)
A date adjuster to move to the previous specified day-of-week, but return the
original date if the day is already correct.
Declaration
public static Func<LocalDate, LocalDate> PreviousOrSame(IsoDayOfWeek dayOfWeek)
Parameters
Type |
Name |
Description |
IsoDayOfWeek |
dayOfWeek |
The day-of-week to adjust dates to. |
Returns
Type |
Description |
Func<LocalDate, LocalDate> |
An adjuster which advances a date to the previous occurrence of the
specified day-of-week, or the original date if the day is already corret. (The value returned is never null.) |