Skip to content

ngxpert/smart-date-input

Repository files navigation

Smart Date Input

A smart date input directive that uses the Writer API to parse natural language dates.

Pre-requisites

Works only on Chrome. You need to enable the Writer API.

  1. For localhost
  2. For origin trial

Getting Started

Step 1: Build the library

ng build @ngxpert/smart-date-input

Step 2: Run the application

ng serve

Usage

For single date input:

<input
  type="text"
  smartDateInput
  (smartDateInputResponseReceived)="onResponseReceivedForSingleDate($event)"
/>

For date range input:

<input
  type="text"
  smartDateInput
  [smartDateInputIsRange]="true"
  (smartDateInputResponseReceived)="onResponseReceivedForDateRange($event)"
/>

Checkout src/app/app.html for more details.

About

Convert natural language to date using Built-in-AI in Angular

Resources

Stars

Watchers

Forks

Languages