TimeComponent
A component that displays and edits a time.
You can add this component using SettingEx.addTime.
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 { TimeComponent } from 'obsidian-dev-utils/obsidian/setting-components/time-component';Signature:
export class TimeComponent extends TypedRangeTextComponent<moment.Duration>Extends: TypedRangeTextComponent<moment.Duration>
Constructor
new TimeComponent(containerEl: HTMLElement)Creates a new time component.
Methods
| Method | Returns | Description |
|---|---|---|
| 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) |
| valueFromString(str) | moment.Duration | Converts a string to a time. |
| valueToString(value) | string | Converts a time to a string. |
Links to this page: