0 votes
86 views
in Jquery by
How to find difference between two dates? Is there a lightweight library?

1 Answer

0 votes
by
Yes, you can use Jquery calendar, Moment.js, Day.js etc

I personanlly recommend the Day.js as its very lightweight

<script src="https://unpkg.com/dayjs@1.8.21/dayjs.min.js"></script>
<script>dayjs().format()</script>

    const date1 = dayjs('2019-01-25')
    const date2 = dayjs('2019-01-26')
    var diff = date1.diff(date2, 'day')

Related questions

0 votes
1 answer 121 views
0 votes
1 answer 874 views
0 votes
1 answer 131 views
0 votes
1 answer 171 views
0 votes
1 answer 167 views
0 votes
1 answer 187 views
asked May 25, 2021 in General by Tester jjavelin (120 points)
...