Moment JS Get Current Week Start and End Date Example
In this tutorial, you will learn moment js get current week start and end date. it's simple example of how to get start date and end date of current week in moment. This article goes in detailed on how to get start date and end date of current week in jquery. This article goes in detailed on get start and end date of current week moment.
Here, i will give you simple example of jquery moment js get current week start and end date using startOf() and endOf().
let's see both example with output:
<title>jquery moment example - ItSolutionStuff.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>
<h1>jquery moment example - ItSolutionStuff.com</h1>
var startDate = moment().startOf('week');
var endDate = moment().endOf('week');
console.log('Start Date:' + startDate.format('MM/DD/YYYY'));
console.log('End Date:' + endDate.format('MM/DD/YYYY'));
I hope it can help you...
- Moment JS Get Day Name from Date Example
- Moment Difference Between Two Dates in Hours Minutes and Seconds
- Moment JS Difference Between Two Dates In Years, Months, Days
- Moment JS Check if Date is Future or not Example
- Moment JS Check if Date is Past or not Example
- Moment JS Humanize Duration | Moment fromNow() Example
- How to Get Next Month Date in Moment JS?
- Moment JS Get Last Date of Month Example
- Moment JS Get Month Name from Number Example
- Jquery Moment Convert String to Date Example