- function submitTopDay() {//上一天
- s = '2006-07-04';
- d = new Date(Date.parse(s.replace(/-/g, '/')));
- d.setDate(d.getDate()-1);
- t = [d.getYear(), d.getMonth()+1, d.getDate()];
- alert(t.join('-'));
- }
- function submitNextDay() {//下一天
- s = '2006-07-04';
- d = new Date(Date.parse(s.replace(/-/g, '/')));
- d.setDate(d.getDate()+1);
- t = [d.getYear(), d.getMonth()+1, d.getDate()];
- alert(t.join('-'));
- }
(js控制)根据当前日期,按上一天下一天显示相应日期
最新推荐文章于 2024-06-20 17:21:13 发布