表单序列化json字符串和js时间格式化
来源:互联网 发布:python for迭代 next 编辑:程序博客网 时间:2024/06/09 15:52
js时间格式化
new Date().format(“时间格式")
Date.prototype.format = function(fmt) {
var o = {"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"H+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"q+" : Math.floor((this.getMonth()+3)/3), //季度
"S" : this.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
}
//表单序列化json字符串
$.fn.serializeObject = function(){var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};
0 0
- 表单序列化json字符串和js时间格式化
- Newtonsoft.Json序列化字符串-格式化和时间格式问题
- js格式化json时间
- json时间格式化(JS)
- js字符串格式化时间
- 表单序列化为json字符串
- Json对象与Json字符串互转(4种转换方式)表单提交和表单序列化
- json表单序列化
- js中格式化时间字符串
- js中格式化时间字符串
- 将表单序列化为json字符串
- json时间数据,使用javascript格式化字符串
- 关于json时间字符串格式化处理
- js表单序列化
- js表单序列化
- JS将表单序列化成 json
- js将form内的表单序列化为json字符串、数组、对象
- 表单序列化及格式化表单序列化方法
- java核心技术学习笔记 20170316
- 哈佛《幸福课》 第1课 什么是积极心理学
- EventBus
- 如何使用XX-Net
- css制作尖角
- 表单序列化json字符串和js时间格式化
- 【计算机网络】I/O多路转接之select
- 了解 Spring Data JPA
- win32中使用打印机
- React+webpack开发环境的搭建
- springMVC+shiro异常处理总结
- 图片adjustviewbound属性 和Scaletype
- hash_map介绍与使用
- mysql的视图