File

src/lib/src/component/md/md-date-format.component.ts

Extends

BaseDateFormatComponent

Implements

OnInit

Metadata

providers { provide: NG_VALUE_ACCESSOR, useExisting: , multi: } { provide: NG_VALIDATORS, useExisting: , multi: }
selector md-date-format
templateUrl ./md-date-format.component.html

Index

Methods
Inputs

Constructor

constructor(dateAdapter: DateAdapter)
Parameters :
Name Type Optional Description
dateAdapter DateAdapter<NativeDateAdapter>

Inputs

locale

Default value: pt-BR

Methods

ngOnInit
ngOnInit()
Returns : void
import { Component, Input, forwardRef, OnInit } from '@angular/core';
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
import { DateAdapter, NativeDateAdapter } from '@angular/material';

/* Own modules */
import { BaseDateFormatComponent } from '../base-date-format.component';

@Component({
    selector: 'md-date-format',
    templateUrl: './md-date-format.component.html',
    providers: [
        { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MdDateFormatComponent), multi: true },
        { provide: NG_VALIDATORS, useExisting: forwardRef(() => MdDateFormatComponent), multi: true }
    ]
})
export class MdDateFormatComponent extends BaseDateFormatComponent implements OnInit {
  @Input() locale = 'pt-BR';

  constructor(private dateAdapter: DateAdapter<NativeDateAdapter>) {
    super();
  }

  ngOnInit() {
    super.ngOnInit();

    this.dateAdapter.setLocale(this.locale);
  }
}
<md-form-field>
    <input mdInput
        type='tel'
        [ngClass]='cssclass'
        [textMask]='{mask:dateMask}'
        [placeholder]='placeholder'
        [readonly]='readonly'
        [name]='inputname'
        [(ngModel)]='_date'

        [min]="minDate"
        [max]="maxDate"

        (focus)='focusEvent($event)'
        (keyup)='keyUpEvent($event)'
        (keydown)='keyDownEvent($event)'
        [disabled]='isDisabled()'
    />
</md-form-field>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""