WeekComponent
A component that displays and edits a Week.
You can add this component using SettingEx.addWeek.
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 { WeekComponent } from 'obsidian-dev-utils/obsidian/setting-components/week-component';Signature:
export class WeekComponent extends TypedRangeTextComponent<IsoWeek>Extends: TypedRangeTextComponent<IsoWeek>
Constructor
new WeekComponent(containerEl: HTMLElement)Creates a new Week component.
Properties
| Property | Type | Description |
|---|---|---|
| inputEl | HTMLInputElement | An input element of the component. (Inherited from TypedRangeTextComponent) |
| textComponent | TextComponent | The inner text component. (Inherited from TypedRangeTextComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| getValue() | IsoWeek | Gets the value of the component. (Inherited from TypedRangeTextComponent) |
| onChange(callback) | this | Sets the callback function to be called when the component is changed. (Inherited from TypedRangeTextComponent) |
| onChanged() | void | Called when the component is changed. (Inherited from TypedRangeTextComponent) |
| setDisabled(disabled) | this | Sets the disabled state of the component. (Inherited from TypedRangeTextComponent) |
| setMax(max) | this | Sets the maximum value of the component. (Inherited from TypedRangeTextComponent) |
| setMin(min) | this | Sets the minimum value of the component. (Inherited from TypedRangeTextComponent) |
| setStep(step) | this | Sets the step value of the component. (Inherited from TypedRangeTextComponent) |
| setValue(value) | this | Sets the value of the component. (Inherited from TypedRangeTextComponent) |
| valueFromString(str) | IsoWeek | Converts a string to a Week. |
| valueToString(value) | string | Converts a week to a string. |
| valueToString(value) | string | Converts a value to a string. (Inherited from TypedRangeTextComponent) |
Links to this page: