How To Get Current Week Lastday in JavaScript?

Sep 28, 2021 . Admin



Hello Friends,

Now let's see example of how to use javascript get current week lastday example. We will use how to use if get current week lastday in javascript. Here you will learn how to use javascript get current week lastday. This is a short guide on get current week lastday. Let's get started with how to get current week lastday in javascript.

Here i will give you many example how you can check javascript get current week lastday. Example : 1
<!DOCTYPE html>
<html>
		<head>
				<meta charset="utf-8">
				<title>JavaScript Current Week Last Day - MyWebtuts.com </title>
		</head>
		<body>
				<script type="text/javascript">
						function LastDay(date)
						{
								var lastday = date.getDate() - (date.getDay() - 1) + 6;
								return new Date(date.setDate(lastday));
						}
						dt = new Date(); 
						document.write(LastDay(dt).toString());
				</script>
		</body>
</html>
Output :
Sun Aug 01 2021 17:26:01 GMT+0530 (India Standard Time)
Example : 2
<!DOCTYPE html>
<html>
		<head>
				<meta charset="utf-8">
				<title>JavaScript Current Week Last Day - MyWebtuts.com </title>
		</head>
		<body>
				<script type="text/javascript">
						function LastWeekDay(date)
						{
								var lastday = date.getDate() - (date.getDay() - 1) + 6;
								return new Date(date.setDate(lastday));
						}
						dt = new Date(); 
						document.write(LastWeekDay(dt).toString());
				</script>
		</body>
</html>
Output :
Sun Aug 01 2021 17:40:07 GMT+0530 (India Standard Time)

It will help you....

#Javascript