Docs
Date

Date

Insert and format dates in your document.

🕐 Date

Insert and display dates within your text using inline date elements. These dates can be easily selected and modified using a calendar interface.
Try selecting

or

.

Features

  • Insert and display dates within your text using inline date elements.
  • These dates can be easily selected and modified using a calendar interface.

Installation

npm install @udecode/plate-date

Plugins

import { createInlineDatePlugin } from ' @udecode/plate-date';
 
const plugins = [
  // ...otherPlugins,
  createInlineDatePlugin()
];

API

insertInlineDate

Options

Collapse all

    The editor instance.

    The date string to insert, in the format 'YYYY-MM-DD' (e.g., '2024-04-22'). If not provided, the current date will be used as the default.

    The options for inserting nodes.

isPointNextToNode

Options

Collapse all

    The editor instance.

    The type of node to check for adjacency. This should be a string representing the node type, such as 'inline_date' for inline date elements.

    The options for checking adjacency:

    • at: An optional Point object specifying the position to check from. If not provided, the current selection anchor will be used.
    • reverse: A boolean indicating the direction to check. If true, checks the previous node; if false, checks the next node.