# ngx-month-menu

> This is an Angular library that allows users to select a year and month combination from a dropdown menu. It displays options for the current year, the last four months, and the last four years, along with a list of months from January to December.

Latest version **0.0.5** (published 2023-09-16) · 0 weekly downloads

## Install

```sh
npm install ngx-month-menu
pnpm add ngx-month-menu
yarn add ngx-month-menu
bun add ngx-month-menu
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-09-16 |
| First published | 2023-09-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 75.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sudeshsk |
| Keywords | month menu, angular menu, material month dropdown |

## Links

- npm: https://www.npmjs.com/package/ngx-month-menu
- npm.io page: https://npm.io/package/ngx-month-menu

## Dependencies (1)

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

## Recent versions

- 0.0.5 (latest) — 2023-09-16
- 0.0.4 — 2023-09-16
- 0.0.2 — 2023-09-16
- 0.0.1 — 2023-09-16

## README

# ngx-month-menu dropdown

This is an Angular library that allows users to select a year and month combination from a dropdown menu. It displays options for the current year, the last four months, and the last four years, along with a list of months from January to December.

## Demo

https://stackblitz.com/edit/angular-ivy-cqkjx4

## Table of Contents

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Customization](#customization)
- [License](#license)
- [Author](#author)

## Prerequisites

Before you begin, ensure you have met the following requirements:

- Angular 12
- Angular Material 12
- material-design-icons-iconfont

## Installation

1. `npm i ngx-month-menu`
2. `npm i material-design-icons-iconfont@6.7`
3. Import the library:
   ```typescript
   @NgModule({
        declarations: [
            ...
        ],
        imports: [
            ...
            NgxMonthMenuModule   
        ];
   });

## Usage
- When you run your Angular application, the ngx-month-menu will display a dropdown menu in your template.

- The dropdown menu will contain options for the current year, the last four months, and the last four years, along with the months from January to December.

- When a user selects a year and month, the (selectedYearMonth) event will be emitted with the selected item in the format year=2020&month=4.

- You can handle this event by implementing the onSelectYearMonth function in your component and extracting the selected year and month for further processing.

- In Template
```typescript
<ngx-month-menu (selectedYearMonth)="onSelectYearMonth($event)">
</ngx-month-menu>
```
- In Component
```typescript
onSelectYearMonth(selectedItem: string): void {
  // Parse the selected item and do something with it
  const [year, month] = selectedItem.split('&').map(param => param.split('=')[1]);
  console.log(`Selected Year: ${year}, Selected Month: ${month}`);
  // Add your custom logic here
}
```
- Output
```typescript
Selected Year: 2023, Selected Month: 9
```
## Customization
You can customize the appearance and behavior of the ngx-month-menu by modifying its HTML template, styles, and Angular code to suit your project's needs.

## License
This component is provided under the MIT License.

## Author
- Sudesh A K

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