# compareMonth Type documentation

## TypeScript declaration

### [compareMonth](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L584-L585>)

**Kind:** constant

```
import { compareMonth } from '@siemens/element-ng/datepicker';
```

Compares two months.

Returns: 0 if the months are equal, a number less than 0 if the first month is earlier, a number greater than 0 if the first month is later.

```
(first: Date, second: Date) => number = ...
```

```
compareMonth(first: Date, second: Date): number
```

Compares two months.

Returns: 0 if the months are equal, a number less than 0 if the first month is earlier, a number greater than 0 if the first month is later.

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [first](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L584-L584>) | `Date` |  | • The first month to compare. |
| [second](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L584-L584>) | `Date` |  | • The second month to compare. |

**Returns:** [number](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number>)
