Data Transformer Date-parse

Edit on GitHub

This document provides details about the Data Transformer Date-parse service in the Components Library.

Overview

Data Transformer Date-parse is an Angular Service that parses the string value as a Date ISO into the JS Date Object. In the example below, the datasource transforms the date string into the parsed date object.

<spy-select
  [datasource]="{
    type: 'inline',
    data: '2020-09-24T15:20:08+02:00',
    transform: {
      type: 'date-parse'
    },
  }"
></spy-select>

Interfaces

Below you can find interfaces for Data Transformer Date-parse.

export interface DateParseDataTransformerConfig extends DataTransformerConfig {}

// Service registration
@NgModule({
  imports: [
    DataTransformerModule.withTransformers({
      'date-parse': DateParseDataTransformerService,
    }),
  ],
})
export class RootModule {}