Help is always welcome. There are areas where you can help:
-
The core functionality (performance improvements, bug fixes, new features, etc.).
-
Documentation (markdown documents, TSDoc annotations in source code).
-
Test suite & development environment improvements.
-
The website.
If you see a gap, but don't have time, experience, or you just need help with the library, don't hesitate to start a discussion or open a new issue.
Due to the modular nature of date-fns, it's more than open to new features. However, when a new function duplicates the existing functionality, native API or causes a significant build size increase, a PR might be rejected, or the author can be asked to move the code to a new or another package.
Please follow the main contributing rules, to maintain date-fns' top quality:
-
Follow style guides:
-
Write tests.
-
Don't update the changelog.
-
Don't change the library version.
-
Fork the project, and clone your fork of the repo
-
Run
pnpm installto install the dependencies
Node.js:
pnpm vitest run
# Or in the watch mode:
pnpm vitest watchBrowser
pnpm vitest run --browser
# Or in the watch mode:
pnpm vitest watch --browserTo test functions in a REPL, use tsx:
pnpm tsx...and then require individual functions:
> const toDate = require('./src/toDate').default
undefined
> toDate(1392098430000).toString()
'Tue Feb 11 2014 14:00:30 GMT+0800 (Singapore Standard Time)'
>To test the build, run:
./scripts/build/package.sh
cd lib
npm link
cd YOUR_PROJECT
npm link date-fnsThe project follows Prettier code style and uses ESLint as the linter. To lint the code, run:
pnpm run lint