在日期控件中提取日期数据,并在另一个文本框中显示其年份加1 |
2016-07-01 14:38
281 查看
<td class="back">启用日期:
<input id="vc_fdate" name="vc_fdate" type="text" class="easyui-datebox form-control" value=""/>
截止日期:
<input id="vc_tdate" name="vc_tdate" type="text" class="easyui-datebox form-control" value="" readonly/>
</td>
$Dialog().date($('#vc_fdate'),function(){
var fdate = $("#vc_fdate").val();
var _tdate = addDate(fdate,'365');
var tdate = _tdate.getFullYear()+"-"+(_tdate.getMonth()+1)+"-"+_tdate.getDate();
$("#vc_tdate").val(tdate);
});
});
function addDate(vc_tdate,vc_fdate){
var a = new Date(vc_tdate);
a = a.valueOf();
a = a + vc_fdate * 24 * 60 * 60 * 1000;
a = new Date(a);
return a;
}
<input id="vc_fdate" name="vc_fdate" type="text" class="easyui-datebox form-control" value=""/>
截止日期:
<input id="vc_tdate" name="vc_tdate" type="text" class="easyui-datebox form-control" value="" readonly/>
</td>
$Dialog().date($('#vc_fdate'),function(){
var fdate = $("#vc_fdate").val();
var _tdate = addDate(fdate,'365');
var tdate = _tdate.getFullYear()+"-"+(_tdate.getMonth()+1)+"-"+_tdate.getDate();
$("#vc_tdate").val(tdate);
});
});
function addDate(vc_tdate,vc_fdate){
var a = new Date(vc_tdate);
a = a.valueOf();
a = a + vc_fdate * 24 * 60 * 60 * 1000;
a = new Date(a);
return a;
}
相关文章推荐
- js实现刮刮卡效果
- python学习笔记
- ECshop2.37开源程序 php5.6报错
- 『python学习』keras库学习
- __name__ == '__main__'
- Mac 批量删除 .svn 文件
- 数据库sql语句
- Android网络访问库 - Retrofit学习(1)基础
- 使用CSDN-markdown编辑器
- MySQL 5.7 学习心得之安全相关特性
- 常用加解密工具类(MD5、SHA、DES、AES、RSA)
- iOS中实现模糊效果(附带多种滤镜探索,你值得转载)
- 编写一个程序实现单链表的各种基本运算(假设顺序表的元数基本类型为Char)
- 也许,DOM 不是答案
- ios 图标字体
- 很棒的Bootstrap选项卡切换效果
- ucos ii笔记
- 为什么决定要写博客
- 点击页面中的重新选择字样后所选内容重置
- uCOS-ii笔记