Skip to content

DateComponent

A component that displays and edits a date.

You can add this component using SettingEx.addDate.

In order to add the styles for the component, use initPluginContext in your plugin’s onload() function.

Alternatively, you can copy styles from https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css.

Import:

import { DateComponent } from 'obsidian-dev-utils/obsidian/setting-components/date-component';

Signature:

export class DateComponent extends TypedRangeTextComponent<Date>

Extends: TypedRangeTextComponent<Date>

Constructor

new DateComponent(containerEl: HTMLElement)

Creates a new date component.

Methods

MethodReturnsDescription
setMax(max)thisSets the maximum value of the component.
(Inherited from TypedRangeTextComponent)
setMin(min)thisSets the minimum value of the component.
(Inherited from TypedRangeTextComponent)
setStep(step)thisSets the step value of the component.
(Inherited from TypedRangeTextComponent)
valueFromString(str)DateConverts a string to a date.
valueToString(value)stringConverts a date to a string.

Links to this page: