@crotched/material-luxon-adapter
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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}}
  ]
})

Package Sidebar

Install

npm i @crotched/material-luxon-adapter

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

242 kB

Total Files

23

Last publish

Collaborators

  • trik