date-fns
⏳ Modern JavaScript date utility library ⌛️ (by date-fns)
dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API (by iamkun)
Our great sponsors
- Appwrite - The open-source backend cloud platform
- SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
- Amplication - open-source Node.js backend code generator
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- Mergify - Updating dependencies is time-consuming.
- Sonar - Write Clean JavaScript Code. Always.
date-fns | dayjs | |
---|---|---|
110 | 91 | |
32,340 | 44,158 | |
1.3% | - | |
8.1 | 8.3 | |
5 days ago | 6 days ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
date-fns
Posts with mentions or reviews of date-fns.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-06-09.
-
What library do you use to handle dates?
In past i used Moment, but I read that we should avoid to use it for future projects. I read someone suggested to use Datejs, but it doesn't seems to be updated, last time was 8 years ago. Currently I'm thinking to use Luxon but I someone suggest Date-fns also.
-
20 Essential Parts Of Any Large Scale React App
date-fns : Date handling
-
Launching my first Expo app 🥳
Thanks! I used date-fns for the calendar
-
What big media wants us to think.
I've used this before and I like it more
-
Common Date formatter libraries in React (TypeScript)
The default date constructor does a really great job at parsing in most cases and things like addition/subtraction along with many other common operations are usually just simple math. If you really want to abstract that use date-fns where most date operations are tree shakable to be left with just a few lines of code.
-
What is your must have npm package on any given project?
date-fns and mitt (event emitter) are also frequent helpers, but I'm considering dayjs and nanoevents for these cases.
- I literally wouldn't even, even if i could, y'all.
-
Everything you need to know about Temporal Date API
We all know the pain of working with dates in Javascript. It needs to be more explicit, has almost no method, and could not be more clunky. For example, to create the Date January 1, 2023, you have to write a new Date (2023, 0, 1), which can be confusing for beginners, and overall just not that clear. And because of these reasons, the community has made many libraries that attempt to make Date easier to work with over the past years. Like momentjs or Date-fns. But the good news is that you won't need these third-party libraries any longer. The Temporal Date API in Javascript attempts to completely replace the Date object and fix all of the issues we generally face when working with dates.
-
Building a real-time commenting app with Socket.io and React
Next we're going to install any additional dependencies we need. In our case, we're just going to need date-fns which is a library that makes it trivial to work with datetimes in JavaScript.
-
Buddy got sick of unpredictable date calculations with JavaScript Date() objects
Obligatory plug for date-fns. https://date-fns.org/
dayjs
Posts with mentions or reviews of dayjs.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-07-20.
-
Managify: Manage Your Teams Easily
DayJS is a lightweight and fast JavaScript library for manipulating dates and times. It offers a moment.js-like API but with a much smaller footprint.
- is there a date calculate script/libary ?
-
What library do you use to handle dates?
I use Day.js in my projects.
-
Flash News App React Native (Expo^)
well, I haven't reviewed the code, I just checked package.json and I'll suggest you to ditch moment.js Even the creator recommends ditching it. dayjs is a fantastic alternative.
- What big media wants us to think.
- Common Date formatter libraries in React (TypeScript)
-
You don't need zero JS website for a perfect Lighthouse score
This may sound a bit general but we can't forget about well-tought code. If we are using a lot of external dependencies, we can check if there aren't many lighter alternatives. Example? Some people are still using moment.js for date formatting. Why not use a lightweight 2kb alternative instead? Writing clean, organized and maintainable code won't give us a huge score boost but we are trying to save every byte of data, right? 😉
-
10 Powerful Node.js Libraries Every Developer Should Know About
10.dayjs
-
What is your must have npm package on any given project?
date-fns and mitt (event emitter) are also frequent helpers, but I'm considering dayjs and nanoevents for these cases.
- [AskJS] Which JS libraries and packages are currently your favourites?
What are some alternatives?
When comparing date-fns and dayjs you can also consider the following projects:
Luxon - ⏱ A library for working with dates and times in JS
moment - Parse, validate, manipulate, and display dates in javascript.
moment-timezone - Timezone support for moment.js
countdown.js - Super simple countdowns.
timeago.js - :clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.
js-joda - :clock2: Immutable date and time library for javascript
fecha - Lightweight and simple JS date formatting and parsing
Mongoose - MongoDB object modeling designed to work in an asynchronous environment.