# PlainDate

`import { PlainDate } from "destack:time";`

Temporal plain date.

```ds title="PlainDate"
export class PlainDate {
    static from(item: PlainDate | PlainDateLike | string, options?: AssignmentOptions | undefined): PlainDate;
    static compare(one: PlainDate | PlainDateLike | string, two: PlainDate | PlainDateLike | string): -1 | 0 | 1;
    constructor(isoYear: float64, isoMonth: float64, isoDay: float64, calendar?: string | undefined);
    get era(): MaybeOwned<string> | undefined;
    get eraYear(): float64 | undefined;
    get year(): float64;
    get month(): float64;
    get monthCode(): Cow<"frame", string>;
    get day(): float64;
    get calendarId(): Cow<"frame", string>;
    get dayOfWeek(): float64;
    get dayOfYear(): float64;
    get weekOfYear(): float64 | undefined;
    get yearOfWeek(): float64 | undefined;
    get daysInWeek(): float64;
    get daysInYear(): float64;
    get daysInMonth(): float64;
    get monthsInYear(): float64;
    get inLeapYear(): boolean;
    equals(other: PlainDate | PlainDateLike | string): boolean;
    with(dateLike: { era?: string; eraYear?: float64; year?: float64; month?: float64; monthCode?: string; day?: float64; calendar?: CalendarLike }, options?: AssignmentOptions | undefined): PlainDate;
    withCalendar(calendar: string | ZonedDateTime | PlainDateTime | PlainDate | PlainYearMonth | PlainMonthDay): PlainDate;
    add(durationLike: Duration | DurationLike | string, options?: ArithmeticOptions | undefined): PlainDate;
    subtract(durationLike: Duration | DurationLike | string, options?: ArithmeticOptions | undefined): PlainDate;
    until(other: PlainDate | PlainDateLike | string, options?: DifferenceOptions<"year" | "month" | "week" | "day"> | undefined): Duration;
    since(other: PlainDate | PlainDateLike | string, options?: DifferenceOptions<"year" | "month" | "week" | "day"> | undefined): Duration;
    toPlainDateTime(time?: PlainTime | PlainTimeLike | string | undefined): PlainDateTime;
    toZonedDateTime(options: string | { timeZone: TimeZoneLike; plainTime?: PlainTime | PlainTimeLike | string }): ZonedDateTime;
    toPlainYearMonth(): PlainYearMonth;
    toPlainMonthDay(): PlainMonthDay;
    toLocaleString(locales?: LocalesArgument | undefined, options?: DateTimeFormatOptions | undefined): Cow<"frame", string>;
    toJSON(): Cow<"frame", string>;
    toString(options?: ShowCalendarOption | undefined): Cow<"frame", string>;
    valueOf(): never;
}
```

[language/library/src/time/plain-date.ds:47:233](https://github.com/destack-sh/destack/blob/main/language/library/src/time/plain-date.ds#L47-L233)

## Members

### `static from(item: PlainDate | PlainDateLike | string, options?: AssignmentOptions | undefined): PlainDate`

Create a plain date.

### `static compare(one: PlainDate | PlainDateLike | string, two: PlainDate | PlainDateLike | string): -1 | 0 | 1`

Compare two plain dates.

### `constructor(isoYear: float64, isoMonth: float64, isoDay: float64, calendar?: string | undefined)`

Create a plain date.

### `get era(): MaybeOwned<string> | undefined`

Calendar era.

### `get eraYear(): float64 | undefined`

Calendar era year.

### `get year(): float64`

Calendar year.

### `get month(): float64`

Calendar month.

### `get monthCode(): Cow<"frame", string>`

Calendar month code.

### `get day(): float64`

Calendar day.

### `get calendarId(): Cow<"frame", string>`

Calendar identifier.

### `get dayOfWeek(): float64`

Day of week.

### `get dayOfYear(): float64`

Day of year.

### `get weekOfYear(): float64 | undefined`

Week of year.

### `get yearOfWeek(): float64 | undefined`

Week-based year.

### `get daysInWeek(): float64`

Days in this week.

### `get daysInYear(): float64`

Days in this year.

### `get daysInMonth(): float64`

Days in this month.

### `get monthsInYear(): float64`

Months in this year.

### `get inLeapYear(): boolean`

Whether this year is a leap year.

### `equals(other: PlainDate | PlainDateLike | string): boolean`

Return true when this date equals `other`.

### `with(dateLike: { era?: string; eraYear?: float64; year?: float64; month?: float64; monthCode?: string; day?: float64; calendar?: CalendarLike }, options?: AssignmentOptions | undefined): PlainDate`

Return this date with updated fields.

### `withCalendar(calendar: string | ZonedDateTime | PlainDateTime | PlainDate | PlainYearMonth | PlainMonthDay): PlainDate`

Return this date in another calendar.

### `add(durationLike: Duration | DurationLike | string, options?: ArithmeticOptions | undefined): PlainDate`

Add a duration.

### `subtract(durationLike: Duration | DurationLike | string, options?: ArithmeticOptions | undefined): PlainDate`

Subtract a duration.

### `until(other: PlainDate | PlainDateLike | string, options?: DifferenceOptions<"year" | "month" | "week" | "day"> | undefined): Duration`

Return the duration until `other`.

### `since(other: PlainDate | PlainDateLike | string, options?: DifferenceOptions<"year" | "month" | "week" | "day"> | undefined): Duration`

Return the duration since `other`.

### `toPlainDateTime(time?: PlainTime | PlainTimeLike | string | undefined): PlainDateTime`

Combine this date with a time.

### `toZonedDateTime(options: string | { timeZone: TimeZoneLike; plainTime?: PlainTime | PlainTimeLike | string }): ZonedDateTime`

Convert this date into a zoned date-time.

### `toPlainYearMonth(): PlainYearMonth`

Return the year-month part.

### `toPlainMonthDay(): PlainMonthDay`

Return the month-day part.

### `toLocaleString(locales?: LocalesArgument | undefined, options?: DateTimeFormatOptions | undefined): Cow<"frame", string>`

Return a locale-aware string.

### `toJSON(): Cow<"frame", string>`

Return a JSON string.

### `toString(options?: ShowCalendarOption | undefined): Cow<"frame", string>`

Return an ISO string.

### `valueOf(): never`

Reject numeric coercion.
