File

src/demo/app/app.component.ts

Metadata

selector demo-app
templateUrl ./app.component.html

Index

Properties
Methods

Constructor

constructor()

Methods

Private updateDate
updateDate(ev: )
Parameters :
Name Type Optional Description
ev
Returns : void

Properties

Private minDate
minDate:
Default value : 01/01/1900
Private options
options:
import { Component } from '@angular/core';

@Component({
  selector: 'demo-app',
  templateUrl: './app.component.html'
})
export class AppComponent {
  private minDate = '01/01/1900';
  private options = {
    minDate: '01/01/1900',
    maxDate: 'today',
    usefullDate: false,
    holiday: false,
    weekend: false
  };

  constructor() {
    this.updateDate('date');
  }

  private updateDate(ev) {
    console.log(ev);
  }
}
<div>
    <h1>Try some configs:</h1>
    <input type="datetime" name="" value="">
    <input type="date" name="" value="">
    <input type="checkbox" name="" value="Usefull Date">
    <input type="checkbox" name="" value="Holiday">
    <input type="checkbox" name="" value="Weekend">

    <date-format
      [minDate]="options.minDate"
      [maxDate]="options.maxDate"
      [usefullDate]="options.usefullDate"
      [holiday]="options.holiday"
      [weekend]="options.weekend"
      placeholder="DD/MM/YYYY"
      (ngModelChange)="updateDate($event)">
    </date-format>

    <h2>Raw config:</h2>
    <p>{{ options | json }}</p>
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""