Horje
Get First Day and last day of week javascript Code Example
Get First Day and last day of week javascript
var curr = new Date; // 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 firstday = new Date(curr.setDate(first)).toUTCString();
var lastday = new Date(curr.setDate(last)).toUTCString();

firstday
"Sun, 06 Mar 2011 12:25:40 GMT"
lastday
"Sat, 12 Mar 2011 12:25:40 GMT"




Javascript

Related
js set class Code Example js set class Code Example
adding event on enter key keypress in javascript Code Example adding event on enter key keypress in javascript Code Example
lowercase or uppercase all strings in array javascript Code Example lowercase or uppercase all strings in array javascript Code Example
javascript count occurrences of letter in string Code Example javascript count occurrences of letter in string Code Example
go to anchor jquery Code Example go to anchor jquery Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7