> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: LocalDate

## Article: LocalDate

## Article Link: https://dev.wix.com/docs/site-extensions/editor-react-components/editor-react-types/reference/local-date.md

## Article Content:

import { Property, PropertyList, ExpandableSection } from "@wix/docs-ui/content";

# LocalDate

A calendar date with no time or timezone, stored as a string. Use it for a field that sets
a day on its own, such as the date an event begins. The value is an ISO-8601 extended local
date, `YYYY-MM-DD`, for example `'2024-03-15'`.

## Component

In your component code, import the `LocalDate` type from `@wix/editor-react-types`:

```ts
import type { LocalDate } from '@wix/editor-react-types';
```

At runtime it's a plain string:

```ts
type LocalDate = string
```

### Usage

Your code either consumes a value of type `LocalDate` or produces one:

::::tabs
:::Consumers
In a component that receives a `LocalDate`, format it for display or parse it into a
`Date`:

```tsx
import type { LocalDate } from '@wix/editor-react-types';

function EventBadge({ startDate }: { startDate?: LocalDate }) {
  return <time dateTime={startDate}>{startDate}</time>;
}
```
:::
:::Producers
When your code produces a `LocalDate`, for a context or a function return, assign a literal
or derive one from a `Date` in local time:

```ts
import type { LocalDate } from '@wix/editor-react-types';

// A literal value.
const startDate: LocalDate = '2024-03-15';

// Or derived from a Date, in local time.
const today: LocalDate = new Date().toLocaleDateString('en-CA');
```
:::
::::

## Manifest

In your manifest, declare the field with the `localDate` dataType:

```json
{ "dataType": "localDate" }
```

### Declaration

Declare a `localDate` field in one of these ways, depending on where the value comes from:

::::tabs
:::Data-property
Declare it as a data property when the Wix user should set the date in a panel. It takes
`dataType`, `displayName`, and an optional `defaultValue`:

```json
{
  "startDate": {
    "dataType": "localDate",
    "displayName": "Start Date",
    "defaultValue": "2024-03-15"
  }
}
```
:::
:::Context-item
Declare it as a context item when your component supplies the date to descendant
components. It takes just `dataType` and `displayName`:

```json
{
  "startDate": {
    "dataType": "localDate",
    "displayName": "Start Date"
  }
}
```
:::
:::Function-parameter-and-return
Declare it on a function when the function accepts or returns a date. It takes `dataType`
and an optional `displayName`, and a parameter may also set `optional`:

```json
{
  "parameters": [
    {
      "dataType": "localDate",
      "displayName": "Start Date"
    }
  ],
  "returns": {
    "dataType": "localDate"
  }
}
```
:::
::::