Skip to content

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

MethodReturnsDescription
canTransform(value)value is moment.DurationChecks if the value is a Duration.
canTransform(value, key)value is moment.DurationDetermines if the transformer can transform the given value.
(Inherited from TypedTransformer)
restoreValue(transformedValue)moment.DurationRestores the value from a string.
restoreValue(transformedValue, key)moment.DurationRestores the given value.
(Inherited from TypedTransformer)
transformValue(value)stringTransforms the value to a string.
transformValue(value, key)stringTransforms the given value.
(Inherited from TypedTransformer)