List the next upcoming same date of current date in HTML

Use the moment library as below

<script src=”https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js”></script>

let nextMonth = formatDateObj.clone().add(i, ‘months’);

nextMonth.format(‘DD/MM/YYYY’);

Suppose if the current date is 29/12/2023

Next date will be as per above code is 29/01/2024

Leave a comment

Your email address will not be published. Required fields are marked *