Skip to content

DateTransformer

A transformer that can transform Date to an ISO string and back.

Import:

import { DateTransformer } from '@mnaoumov/typescript-lib/transformers/date-transformer';

Signature:

export class DateTransformer extends TypedTransformer<Date, string>

Extends: TypedTransformer<Date, string>

Methods

MethodReturnsDescription
canTransform(value)value is DateDetermines if the value is a Date.
canTransform(value, key)value is DateDetermines if the transformer can transform the given value.
(Inherited from TypedTransformer)
getTransformer(transformerId)TransformerGets the transformer with the given id.
(Inherited from TypedTransformer)
getTransformerId(value, key)null | stringGets the id of the transformer that can transform the given value.
(Inherited from TypedTransformer)
restoreValue(transformedValue)DateRestores the value from a string.
restoreValue(transformedValue, key)DateRestores the given value.
(Inherited from TypedTransformer)
restoreValue(transformedValue, key)unknownRestores the given value.
(Inherited from TypedTransformer)
transformObjectRecursively(value)GenericObjectTransforms the given object recursively.
(Inherited from TypedTransformer)
transformValue(value)stringTransforms the value to a string.
transformValue(value, key)stringTransforms the given value.
(Inherited from TypedTransformer)
transformValue(value, key)unknownTransforms the given value.
(Inherited from TypedTransformer)