0 votes
558 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 663 views
0 votes
1 answer 1.4k views
0 votes
1 answer 625 views
0 votes
1 answer 629 views
0 votes
1 answer 618 views
0 votes
1 answer 553 views
asked May 25, 2021 in General by Tester jjavelin (120 points)
...