cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How Calculate Weekend date and Dates for a Week

I want to get the dates of the current weekend date (Ex:  Saturday ) and Dates for current week monday, tuesday, wednesday, thursday and friday using a calculated Value or any other possibility

Labels: (2)
0 Kudos
Reply
2 Replies
Workflow Hero

Re: How Calculate Weekend date and Dates for a Week

You can do this in a SharePoint calculated field using the available formulas. You would put in a date value in one field, then the calculated field would do the work.

Is there a need for a workflow or form?

0 Kudos
Accept as Solution Reply
Not applicable

Re: How Calculate Weekend date and Dates for a Week

Hi Andrew,

I need it in a Nintex form, I want to display the Current week Dates depending upon a WeekEnding date. So, Calculated Column will not do that.

I have done it with JavaScript but there are few concerns while changing the weekending.

var curr = new Date('2015-12-19T00:00:00'); // get current date
var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week
var last = first + 6; // last day is the first day + 6
var mon = first + 1;
var tue = first+2;
var wed = first+3;
var thu = first+4;
var fri = first+5;

firstday = new Date(curr.setDate(first)).toLocaleDateString('en-US');
lastday = new Date(curr.setDate(curr.getDate()+6)).toLocaleDateString('en-US');
monday = new Date(curr.setDate(mon)).toLocaleDateString('en-US');
tuesday = new Date(curr.setDate(tue)).toLocaleDateString('en-US');
wednesday = new Date(curr.setDate(wed)).toLocaleDateString('en-US');
thursday = new Date(curr.setDate(thu)).toLocaleDateString('en-US');
friday = new Date(curr.setDate(fri)).toLocaleDateString('en-US');

document.write(firstday);

document.write(monday);

document.write(tuesday);

document.write(wednesday);

document.write(thursday);

document.write(friday);

document.write(lastday);

0 Kudos
Accept as Solution Reply