obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
38 lines (37 loc) • 1.13 kB
text/typescript
/**
* @packageDocumentation
*
* Contains a component that displays and edits a date.
*/
import { TypedRangeTextComponent } from './TypedRangeTextComponent.cjs';
/**
* A component that displays and edits a date.
*
* You can add this component using {@link SettingEx.addDate}.
*
* In order to add the styles for the component, use {@link initPluginContext} in your plugin's `onload()` function.
*
* Alternatively, you can copy styles from {@link https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css}.
*/
export declare class DateComponent extends TypedRangeTextComponent<Date> {
/**
* Creates a new date component.
*
* @param containerEl - The container element of the component.
*/
constructor(containerEl: HTMLElement);
/**
* Converts a string to a date.
*
* @param str - The string to convert.
* @returns The date.
*/
valueFromString(str: string): Date;
/**
* Converts a date to a string.
*
* @param value - The date to convert.
* @returns The string.
*/
valueToString(value: Date): string;
}