Skip to content

Latest commit

 

History

History

pick-datetime

Angular date & time picker

GitHub license npm scope

Simple responsive Angular date and time picker.

Quick links

Installing

npm install --save nxt-pick-datetime
npm install --save moment   # if you want to use MomentDateTimeModule

Import main module and DateTime adapter provider

The date & time picker was built to be date implementation agnostic. It comes with two modules providing date adapter implementation, or you can provide your own adapter by implementing DateTimeAdapter (see documentation).

  • NativeDateTimeModule - support for native JavaScript Date object
  • MomentDateTimeModule - support for MomentJs
import { DateTimeModule } from 'nxt-pick-datetime'
import { NativeDateTimeModule } from 'nxt-pick-datetime/native-adapter'

@NgModule({
    ...
    imports: [
        ...
        DateTimeModule,
        NativeDateTimeModule
    ]
})

Use it in a template

<input [nxtDateTime]="picker"
    [nxtDateTimeTrigger]="picker"
    placeholder="Date and time">
<nxt-date-time #picker></nxt-date-time>