Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
karczk-dnv committed Apr 14, 2023
1 parent e856fe3 commit 5b54b1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ formatMoney(-1.53588, { precision: 3, currency: "USD", currencySign: "accounting
```

### formatMonth()
When using month `number` argument please note that JavaScript month index starts from `0` (valid value range: `0-11`).

```typescript
import { formatMonth } from '@dnvgl/i18n';

Expand Down
2 changes: 1 addition & 1 deletion src/formatMonth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DateIsoString } from "./types/dateIsoString";
import { Locale } from "./types/locale";
import { MonthFormat } from "./types/monthFormat";

export function formatMonth(month: number, monthFormat: MonthFormat, locale?: Locale): string
export function formatMonth(monthIndex: number, monthFormat: MonthFormat, locale?: Locale): string
export function formatMonth(date: Date | DateIsoString, monthFormat: MonthFormat, locale?: Locale): string
export function formatMonth(value: Date | DateIsoString | number, monthFormat: MonthFormat, locale?: Locale): string {
const date = typeof value === "number"
Expand Down

0 comments on commit 5b54b1a

Please sign in to comment.