DurationTransformer
A transformer that converts a Duration to an ISO string and back.
Import:
import { DurationTransformer } from 'obsidian-dev-utils/transformers/duration-transformer';Signature:
export class DurationTransformer extends TypedTransformer<moment.Duration, string>Extends: TypedTransformer<moment.Duration, string>
Methods
| Method | Returns | Description |
|---|---|---|
| canTransform(value) | value is moment.Duration | Checks if the value is a Duration. |
| canTransform(value, key) | value is moment.Duration | Determines if the transformer can transform the given value. (Inherited from TypedTransformer) |
| restoreValue(transformedValue) | moment.Duration | Restores the value from a string. |
| restoreValue(transformedValue, key) | moment.Duration | Restores the given value. (Inherited from TypedTransformer) |
| transformValue(value) | string | Transforms the value to a string. |
| transformValue(value, key) | string | Transforms the given value. (Inherited from TypedTransformer) |