# ngx-material-luxon

Latest version **1.1.1** (published 2021-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-material-luxon
pnpm add ngx-material-luxon
yarn add ngx-material-luxon
bun add ngx-material-luxon
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-02-04 |
| First published | 2020-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 174.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | andrei.alecu |
| Keywords | angular, angular 2, ngx-material-luxon, material, angular material, luxon, date adapter |

## Links

- npm: https://www.npmjs.com/package/ngx-material-luxon
- Repository: https://github.com/andreialecu/ngx-material-luxon
- Homepage: https://github.com/andreialecu/ngx-material-luxon#readme
- Issues: https://github.com/andreialecu/ngx-material-luxon/issue
- npm.io page: https://npm.io/package/ngx-material-luxon

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2021-02-04
- 1.1.0 — 2021-01-04
- 1.0.6 — 2021-01-04
- 1.0.5 — 2021-01-01
- 1.0.4 — 2020-12-20
- 1.0.3 — 2020-12-20
- 1.0.2 — 2020-12-20
- 1.0.1 — 2020-12-20
- 1.0.0 — 2020-12-20

## README

<h1 align="center">

 ngx-material-luxon
</h1>

<br />

[![npm](https://img.shields.io/npm/v/ngx-material-luxon?style=flat-square)](https://www.npmjs.com/package/ngx-material-luxon)
[![Downloads](https://img.shields.io/npm/dm/ngx-material-luxon?style=flat-square)](https://www.npmjs.com/package/ngx-material-luxon)
[![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?style=flat-square)](LICENSE)
[![commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](CONTRIBUTING.md#-commit-message-guidelines)
[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/andreialecu/ngx-material-luxon/pulls)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


> Luxon Date Adapter for Angular Material

Credits for most of this go to [crisbeto](https://github.com/crisbeto) in https://github.com/angular/components/pull/14681. 

Original PR has been left unmerged due to https://github.com/angular/components/pull/14681#issuecomment-457685311


## Features

- ✅ Drop an import in your `@NgModule` and enjoy Luxon `DateTime` objects

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [FAQ](#faq)

## Installation

### NPM

`npm install ngx-material-luxon --save`

### Yarn

`yarn add ngx-material-luxon`

## Usage


```ts
import { MatLuxonDateModule } from 'ngx-material-luxon';

@NgModule({
  imports: [MatLuxonDateModule]
})
class AppModule { }
```

## FAQ

### Specifying the first day of the week

Luxon does not support have built-in support for returning the first day of the week of the current locale. However, the library allows overriding it via an optional hook.

Example:

```ts
const firstDayOfWeek = (locale: string) => {
  // 0 = Sunday, 1 = Monday, etc
  return 1;
}

@NgModule({
  imports: [LuxonDateModule],
  providers: [
    {
      provide: MAT_LUXON_DATE_ADAPTER_OPTIONS,
      useValue: { firstDayOfWeek },
    },
  ],
})
```

For most apps, a simple return like above is probably fine. For more complex apps, you can use a third party library like: [weekstart](https://npmjs.com/package/weekstart)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://github.com/andreialecu"><img src="https://avatars0.githubusercontent.com/u/697707?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrei Alecu</b></sub></a><br /><a href="https://github.com/andreialecu/ngx-material-luxon/commits?author=andreialecu" title="Documentation">📖</a> <a href="#infra-andreialecu" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/andreialecu/ngx-material-luxon/commits?author=andreialecu" title="Code">💻</a> <a href="#projectManagement-andreialecu" title="Project Management">📆</a></td>
    <td align="center"><a href="https://harves.net/"><img src="https://avatars3.githubusercontent.com/u/12858056?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daniel Harvey</b></sub></a><br /><a href="https://github.com/andreialecu/ngx-material-luxon/issues?q=author%3Adanielsharvey" title="Bug reports">🐛</a> <a href="https://github.com/andreialecu/ngx-material-luxon/commits?author=danielsharvey" title="Code">💻</a></td>
    <td align="center"><a href="http://crisbeto.com/"><img src="https://avatars0.githubusercontent.com/u/4450522?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kristiyan Kostadinov</b></sub></a><br /><a href="https://github.com/andreialecu/ngx-material-luxon/commits?author=crisbeto" title="Code">💻</a> <a href="https://github.com/andreialecu/ngx-material-luxon/commits?author=crisbeto" title="Tests">⚠️</a> <a href="#ideas-crisbeto" title="Ideas, Planning, & Feedback">🤔</a></td>
  </tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

---
_Source: https://npm.io/package/ngx-material-luxon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
