1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //报名验证提交的调用 侧边栏
- PublicAction.AjaxSend({CORID:'m_bmtj'/*操作ID*/});
- // 有效期 时间加两个自然月
- function getNextMonth(date) {
- var arr = date.split('/');
- var year = arr[0]; //获取当前日期的年份
- var month = arr[1]; //获取当前日期的月份
- var day = arr[2]; //获取当前日期的日
- var days = new Date(year, month, 0);
- days = days.getDate(); //获取当前日期中的月的天数
- var year2 = year;
- var month2 = parseInt(month) + 2;
- if (month2 > 13) {
- year2 = parseInt(year2) + 1;
- if (parseInt(month)==11) {
- month2 = 1;
- }else if (parseInt(month)==12) {
- month2 = 2;
- };
- }
- var day2 = day;
- var days2 = new Date(year2, month2, 0);
- days2 = days2.getDate();
- if (day2 > days2) {
- day2 = days2;
- }
- if (month2 < 10) {
- month2 = '0' + month2;
- }
- var t2 = year2 + '/' + month2 + '/' + day2;
- return t2;
- }
- var myDate = new Date;
- var year = myDate.getFullYear(); //获取当前时间年份
- var yue = myDate.getMonth()+1;//获取当前时间月份
- if (yue<10) {
- yue= '0' + yue;
- };
- // 有效期时间 获取当前时间
- var time = year+'/'+yue+'/01';
- var time_yxq= year+'/'+yue+'/01-'+getNextMonth(time);
- var timew =getNextMonth(time);
- // console.log(time_yxq);
- console.log(timew);
- $('.m_text_title').html('活动时间:'+time_yxq+'');
- $('.m_text_title').html('活动时间:'+time_yxq+'');
|