https://github.com/classfunc/use-dayjs
It's simpler to use dayjs
https://github.com/classfunc/use-dayjs
Last synced: about 1 year ago
JSON representation
It's simpler to use dayjs
- Host: GitHub
- URL: https://github.com/classfunc/use-dayjs
- Owner: ClassFunc
- License: mit
- Created: 2022-06-29T11:59:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T11:23:15.000Z (over 3 years ago)
- Last Synced: 2025-03-22T23:15:21.357Z (about 1 year ago)
- Language: JavaScript
- Size: 256 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## use-dayjs
Simpler to use dayjs
## Support for
```bash
- Typescript
- React js
- Next js
- Node js
```
## Install package
```html
npm i --save use-dayjs
yarn add use-dayjs
```
## Use package
```bash
// Used
import {djsSetLocale} from "use-dayjs/locale";
djsSetLocale('vi')
import {djsFormat} from "use-dayjs/display";
import {djsSet} from "use-dayjs/calculator";
import {djsDay} from "use-dayjs/display";
djsFormat("2022-06-30", "YYYY-MM-DD ddd") //2022-06-30 T5
djsSet(new Date(), {
year: 2025,
month: 0
}) //2025-07-11T08:49:52.569Z
djsDay("2022-07-18") // 1
```
More Actions
```html
1.Calculator
djsDateOfMonth,
djsDayOfWeek,
djsDayOfWeekAware,
djsDayOfWeekISO,
djsSet,
djsDayOfYear,
djsGet,
djsHour,
djsMillisecond,
djsMinute,
djsMonth,
djsQuarter,
djsSecond,
djsWeekInYearISO,
djsWeekOfYear,
djsWeekYear,
djsYear,
djsWeek,
djsWeekDay,
djsDuration,
djsDefault,
djsDefaultUTC,
djsDurationUTC
```
```html
2.Display
djsFormat,
djsFromNow,
djsFromAtTime,
djsToAtTime,
djsCalendar,
djsToNow,
djsDiff,
djsToDateJs,
djsToArray,
djsUnix,
djsDayInMonth,
djsToISOString,
djsToJson,
djsToObject,
djsToString,
djsUnixTimestamp,
djsParseUTC,
djsFormatDDD,
djsFormatDDDD,
djsFormatDDMM,
djsFormatMMDD,
djsFormatUTC,
djsFormatYYYY,
djsFormatYYYYMMDD,
djsFormatYYYYMMDDHHMMSSZ,
```
```html
3.Locale
djsSetLocale,
djsUTCOffset,
djsUTC
```
```html
4.Manipulate
djsAdd,
djsEndOf,
djsStartOf,
djsSubtract,
```
```html
5.Parse
djsParse,
djsParseNow,
djsParseUTC,
djsParseNowUTC,
djsNow,
djsNowUTC,
djsClone
```
```html
6.Query
djsBetween,
djsBetweenRange,
djsIsAfter,
djsIsBefore,
djsIsDayjs,
djsIsLeapYear,
djsIsSame,
djsSameAfter,
djsSameBefore,
djsIsSameDate
```
```html
7.Timezone
djsTz,
djsTzSet,
djsToZone,
djsTzGuess,
djsTzFormat,
djsGTM
```