Skip to content

Commit 4ccd50b

Browse files
committed
refactor: create @louffee/date package
This commit introduces the `@louffee/date` package, which is a utility package for working with dates by adapting the API from the `dayjs` NPM package. See further details in the `dayjs` package on their official website: https://day.js.org/
1 parent 4d392fb commit 4ccd50b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

packages/date/package.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@louffee/date",
3+
"version": "0.0.0",
4+
"private": true,
5+
"main": "./src/index.ts",
6+
"types": "./src/index.ts",
7+
"homepage": "https://github.com/louffee/louffee.co/tree/main/packages/testing-library-ext",
8+
"dependencies": {
9+
"dayjs": "^1"
10+
}
11+
}

packages/date/src/index.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import dayjs, { Dayjs, type FormatObject } from 'dayjs'
2+
3+
/**
4+
* The `date()` function creates a new instance of the `DateHandler` class,
5+
* which is a wrapper around the `dayjs` library.
6+
*
7+
* @see https://day.js.org
8+
* @see https://npmjs.com/package/dayjs
9+
*/
10+
const date = dayjs
11+
12+
/**
13+
* The `DateHandler` is the class representing the date handler which is the
14+
* product of the {@link date | `date()`} function.
15+
*/
16+
export const DateHandler = Dayjs
17+
18+
export type { FormatObject }
19+
20+
export default date

0 commit comments

Comments
 (0)