### File

`projects/angular-l10n/src/lib/directives/l10n-date.directive.ts`

### Metadata

Selector | `[l10nDate]`

### Index

###### Methods

- Protected getValue

###### Inputs

- l10nDate
- options
- timezone

###### Accessors

- l10nDate

### Constructor

`constructor(el: ElementRef, renderer: Renderer2, translation: L10nTranslationService, intl: L10nIntlService)`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:18

Parameters :

Name | Type | Optional
el | `ElementRef` | No
renderer | `Renderer2` | No
translation | `L10nTranslationService` | No
intl | `L10nIntlService` | No

### Inputs

l10nDate
Type : `any`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:12

options
Type : `any`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:16

timezone
Type : `string`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:18

### Methods

Protected getValue
`getValue(text: string)`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:29

Parameters :

Name | Type | Optional
text | `string` | No

Returns : `string`

### Accessors

l10nDate
set `l10nDate(options: any)`
Defined in projects/angular-l10n/src/lib/directives/l10n-date.directive.ts:12

Parameters :

Name | Type | Optional
options | `any` | No

Returns : `void`

    import { Directive, Input, ElementRef, Renderer2 } from '@angular/core';

    import { L10nDirective } from '../models/l10n-directive';
    import { L10nTranslationService } from '../services/l10n-translation.service';
    import { L10nIntlService } from '../services/l10n-intl.service';

    @Directive({
        selector: '[l10nDate]'
    })
    export class L10nDateDirective extends L10nDirective {

        @Input() set l10nDate(options: any) {
            this.options = options;
        }

        @Input() public options: any;

        @Input() public timezone: string;

        constructor(
            protected el: ElementRef,
            protected renderer: Renderer2,
            protected translation: L10nTranslationService,
            protected intl: L10nIntlService
        ) {
            super(el, renderer, translation);
        }

        protected getValue(text: string): string {
            return this.intl.formatDate(text, this.options, this.language, this.timezone);
        }

    }

# result-matching ""

# No results matching ""