kit-input-date

API

[class] KitInputDateDirective

@Directive

Selector:'[kitInputDate]'

Displays date in an input in any format and store JS Date-object in model.

Usage

Use the directive:

<input [(ngModel)]="date"
       kitInputDate>

Format

You can define rendering/parsing format:

<input [(ngModel)]="date"
       kitInputDate
       format="YYYY/DD/MM">

Requires Moment.js.

Example

Members

SignatureDescription
@Input() options: any = {}

Date.toLocaleDateString() options.

@Input() format: string

Parse and render format (works only with moment.js).

readonly viewStateChanges = new Subject<string>()
readonly modelStateChanges = new Subject<any>()
input(value: string, event: any)

Handle input changing by user.

keyDown(event: any)
writeValue(value: any)

Handle external modal changing.

[class] KitInputDateModule

@NgModule

Exports:[ KitValueAccessorModule, KitInputDateDirective, ]