0.0.1 • Published 3 years ago

@crotched/material-luxon-adapter v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Luxon Date adapter

The Luxon Date adapter allows the Angular Material Datepicker component to work with Luxon DateTime objects.

How to use

import {MatLuxonDateModule} from '@crotched/material-luxon-adapter';

@NgModule({
  imports: [MatDatepickerModule, MatLuxonDateModule]
})

By default the LuxonDateAdapter creates dates in your time zone specific locale. You can change the default behaviour to parse dates as UTC by providing the MAT_LUXON_DATE_ADAPTER_OPTIONS and setting it to useUtc: true.

import {MAT_LUXON_DATE_ADAPTER_OPTIONS, MatLuxonDateModule} from '@crotched/material-luxon-adapter';

@NgModule({
  imports: [MatDatepickerModule, MatLuxonDateModule],
  providers: [
    {provide: MAT_LUXON_DATE_ADAPTER_OPTIONS, useValue: {useUtc: true}}
  ]
})