Skip to content

MonthComponent

A component that displays and edits a month.

You can add this component using SettingEx.addMonth.

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 { MonthComponent } from 'obsidian-dev-utils/obsidian/setting-components/month-component';

Signature:

export class MonthComponent extends TypedRangeTextComponent<IsoMonth>

Extends: TypedRangeTextComponent<IsoMonth>

Constructor

new MonthComponent(containerEl: HTMLElement)

Creates a new month 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)IsoMonthConverts a string to a month.
valueToString(value)stringConverts a month to a string.

Links to this page: