snehalmasne / datejs

Automatically exported from code.google.com/p/datejs
Other
0 stars 0 forks source link

when you do var dt2=dt1.next().sunday(), dt1 itself changes to next sunday #188

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Windows 8.1, Chrome Version 35 
Take the following code

var dt1 = Date.today();
alert(dt1.toString("MM/dd/yyyy"));
var dt2 = dt1.next().sunday();
alert(dt1.toString("MM/dd/yyyy"));

The first alert displays today's date. The second alert now displays this 
Sunday's date. dt1's value is being reassigned which is not expected.

Original issue reported on code.google.com by m3mac...@gmail.com on 22 Jun 2014 at 3:17