The most recent item in the train ticket, because the maximum range of train voting dates is 20 days, which is to control a date within 20 days of the current time
began to look for a direct modification of the Web date prototype later the leader said it was not so good, so we can only change another way to write
How to write, train of thought, Day + + turn month following year, good trouble
Viewed from the Internet is too hard to find, and then look at the time conversion
Or do you want to turn the current time into a time string, then add the current time string, get a new time string, a new time string, and convert it into a new time
Probably like the following code
functionAddday (d,s) {varm; varD =NewDate (d); D=d.valueof (); D= d + S * 24 * 60 * 60 * 1000; D=NewDate (d); M= D.getfullyear () + "-" + (D.getmonth () + 1) + "-" +d.getdate (); returnm;}varDate = "2014-8-28";varD = ' +date.split ('-') [0]+ '/' +date.split ('-') [1]+ '/' +date.split ('-') [2];d ocument.write (Addday (D,10))
Basically this is the case, because the need to pass the parameter D format (2014/08/28 or 2014,08,28) The second is not able to pass the first kind of regular conversion is not, can only be transferred once again as parameters passed in
Record it
It's convenient to find it next time.
Long time no angular JS will not forget, the weekend to study ah, with angular, many are lazy to write, now do not have to consider a variety of angular compatibility, crazy fill in
Fortunately there is a handlebar template, operation can be convenient, but there is time to study data binding, in order to write the project convenient point
Date plus minus JS, days group increased, date automatically modified