Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class NodaTime.​DateAdjusters

Assembly: NodaTime

Inheritance: object → DateAdjusters

Factory class for date adjusters: functions from <see cref="T:NodaTime.LocalDate" /> to <c>LocalDate</c> , which can be applied to <see cref="T:NodaTime.LocalDate" /> , <see cref="T:NodaTime.LocalDateTime" /> , and <see cref="T:NodaTime.OffsetDateTime" /> .

Properties

public static System.​Func<​LocalDate, LocalDate>
StartOfMonth
A date adjuster to move to the first day of the current month.
public static System.​Func<​LocalDate, LocalDate>
EndOfMonth
A date adjuster to move to the last day of the current month.

Methods

public static System.​Func<​LocalDate, LocalDate>
DayOfMonth​(int day)
A date adjuster to move to the specified day of the current month.
Returns An adjuster which changes the day to <paramref name="day" /> , retaining the same year and month.
day The day of month to adjust dates to.
Remarks The returned adjuster will throw an exception if it is applied to a date that would create an invalid result.
public static System.​Func<​LocalDate, LocalDate>
Month​(int month)
A date adjuster to move to the same day of the specified month.
Returns An adjuster which changes the month to <paramref name="month" /> , retaining the same year and day of month.
month The month to adjust dates to.
Remarks The returned adjuster will throw an exception if it is applied to a date that would create an invalid result.
public static System.​Func<​LocalDate, LocalDate>
NextOrSame​(IsoDayOfWeek dayOfWeek)
A date adjuster to move to the next specified day-of-week, but return the original date if the day is already correct.
Returns 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 correct.
dayOfWeek The day-of-week to adjust dates to.
public static System.​Func<​LocalDate, LocalDate>
PreviousOrSame​(IsoDayOfWeek dayOfWeek)
A date adjuster to move to the previous specified day-of-week, but return the original date if the day is already correct.
Returns 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 correct.
dayOfWeek The day-of-week to adjust dates to.
public static System.​Func<​LocalDate, LocalDate>
Next​(IsoDayOfWeek dayOfWeek)
A date adjuster to move to the next specified day-of-week, adding a week if the day is already correct.
Returns An adjuster which advances a date to the next occurrence of the specified day-of-week.
dayOfWeek The day-of-week to adjust dates to.
Remarks This is the adjuster equivalent of <see cref="M:NodaTime.LocalDate.Next(NodaTime.IsoDayOfWeek)" /> .
public static System.​Func<​LocalDate, LocalDate>
Previous​(IsoDayOfWeek dayOfWeek)
A date adjuster to move to the previous specified day-of-week, subtracting a week if the day is already correct.
Returns An adjuster which advances a date to the previous occurrence of the specified day-of-week.
dayOfWeek The day-of-week to adjust dates to.
Remarks This is the adjuster equivalent of <see cref="M:NodaTime.LocalDate.Previous(NodaTime.IsoDayOfWeek)" /> .
public static System.​Func<​LocalDate, LocalDate>
AddPeriod​(Period period)
Creates a date adjuster to add the specified period to the date.
Returns An adjuster which adds the specified period.
period The period to add when the adjuster is invoked. Must not contain any (non-zero) time units.
Remarks This is the adjuster equivalent of <see cref="M:NodaTime.LocalDate.Plus(NodaTime.Period)" /> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object