Compartilhar via


TemporalAdjusters.PreviousOrSame(DayOfWeek) Method

Definition

Returns the previous-or-same day-of-week adjuster, which adjusts the date to the first occurrence of the specified day-of-week before the date being adjusted unless it is already on that day in which case the same object is returned.

[Android.Runtime.Register("previousOrSame", "(Ljava/time/DayOfWeek;)Ljava/time/temporal/TemporalAdjuster;", "", ApiSince=26)]
public static Java.Time.Temporal.ITemporalAdjuster? PreviousOrSame (Java.Time.DayOfWeek? dayOfWeek);
[<Android.Runtime.Register("previousOrSame", "(Ljava/time/DayOfWeek;)Ljava/time/temporal/TemporalAdjuster;", "", ApiSince=26)>]
static member PreviousOrSame : Java.Time.DayOfWeek -> Java.Time.Temporal.ITemporalAdjuster

Parameters

dayOfWeek
DayOfWeek

the day-of-week to check for or move the date to, not null

Returns

the previous-or-same day-of-week adjuster, not null

Attributes

Remarks

Returns the previous-or-same day-of-week adjuster, which adjusts the date to the first occurrence of the specified day-of-week before the date being adjusted unless it is already on that day in which case the same object is returned.

The ISO calendar system behaves as follows:<br> The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).<br> The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).<br> The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input).

The behavior is suitable for use with most calendar systems. It uses the DAY_OF_WEEK field and the DAYS unit, and assumes a seven day week.

Java documentation for java.time.temporal.TemporalAdjusters.previousOrSame(java.time.DayOfWeek).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to