JQuery Moment Add Days to Date Example
Hi Guys,
In this example,I will learn you how to add days to date in moment js.you can easy amd simply add to days to date in moment js.
Here, i will give you simple example of jquery moment js add() method for add days to date.let's bellow the example.
Example :
<!DOCTYPE html>
<html>
<head>
<title>JQuery Moment Add Day Example - Nicesnippets.com</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" crossorigin="anonymous"></script>
</head>
<body>
<h1>JQuery Moment Add Day Example - Nicesnippets.com</h1>
</body>
<script type="text/javascript">
var startdate = '15-06-2021'
var newDate = moment(startdate, "DD-MM-YYYY").add(4, 'days').format('DD/MM/YYYY');
console.log(newDate);
</script>
</html>
Output:
19/06/2021
It will help you...
- How to Show Loading Spinner in JQuery?
- How to Create Ajax Submit Form Using jQuery?
- How To Get Current Page URL, Path, Host and hash using jQuery?
- How To Get, Set and Delete Div Background Image jQuery?
- JQuery Remove All Unwanted Whitespace From String Example
- Body Background Video Using Vide Jquery Example
- JQuery UI Autocomplete Example
- JQuery Split String By Comma Into Array Example