Skip to content

Commit bee33bc

Browse files
Create format-date.mdx
fix: adds formatDate documentation
1 parent ced4834 commit bee33bc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: formatDate
3+
---
4+
5+
Formats a date value into a localized string representation using the `toLocaleDateString()` method.
6+
7+
### API
8+
9+
```typescript
10+
interface IFormatDateConfig {
11+
date: ConstructorParameters<typeof Date>[0];
12+
locales?: Intl.LocalesArgument;
13+
options?: Intl.DateTimeFormatOptions;
14+
}
15+
16+
function formatDate(config: IFormatDateConfig): string;
17+
```
18+
19+
### Usage
20+
21+
```typescript
22+
import { formatDate } from "@feedzai/js-utilities";
23+
24+
const formattedDate = formatDate({ date: "2023-12-25" });
25+
26+
console.log(formattedDate); // "December 25"
27+
```

0 commit comments

Comments
 (0)