Date

Insert and format dates in your document.

Loading...

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

Usage

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

Plugins

DatePlugin

Add Date Plugin to your document.

API

isPointNextToNode

Check if a point is next to a specific node type.

Parameters

Collapse all

    The editor instance.

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

    The options for checking adjacency:

Plugin Transforms

editor.insert.date

Insert a date into the editor.

Parameters

Collapse all

    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.