bootstrap中时间显示格式问题
来源:互联网 发布:算法概论注释版pdf 编辑:程序博客网 时间:2024/06/05 03:58
- 数据格式显示方法一:
{name:'starttime',index:'starttime', width:160,edittype:"date", unformat: pickDate,editrules:{required:true},},
//enable datepickerfunction pickDate( cellvalue, options, cell ) {setTimeout(function(){$(cell) .find('input[type=text]').datepicker({format:'yyyy-MM-dd HH:mm:ss' , autoclose:true}); }, 0);}
在此处引用pickDate方法,将返回的毫秒值转换成相应的yyyy-MM-dd HH:mm:ss 格式显示在页面上
- 数据格式显示方法二:
{name:'starttime',index:'starttime', width:160,edittype:"date", formatter:resultFormatter,,editrules:{required:true},},
function getzf(num){ if(parseInt(num) < 10){ num = '0'+num; } return num; }
function resultFormatter(cellvalue, timestamp, rowObject){ var oDate = new Date(cellvalue), oYear = oDate.getFullYear(), oMonth = oDate.getMonth()+1, oDay = oDate.getDate(), oHour = oDate.getHours(), oMin = oDate.getMinutes(), oSen = oDate.getSeconds(), oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间 return oTime; }
这是将传递回来的毫秒值通过计算并且拼接成固定格式返回给页面
目前我用的是这两种方式展示时间,其他的会遇到之后会逐步添加至此。
- 数据中的根据条件筛选问题
dataInit : function (elem) {$(elem).datepicker({format:"yyyy-mm-dd", autoclose:true,editable: false})}}};
标红的部分是设置搜索的格式,这个时候引入的js是<script src="${contextPath }/assets/js/date-time/bootstrap-datepicker.min.js"></script>
其他的搜索功能例如:{name:'content',index:'content', editable: true,hidden:true,search: true,editrules:{edithidden:true},edittype:"text",sortable:false,
formoptions:{elmsuffix:"<i style='color:red'>*</i>"},editoptions:{size:"20",maxlength:"30"},stype:"text",searchoptions:{searchhidden:true}},
{name:'lineid',index:'lineid', width:90, sortable:false,editable: true,edittype:"select",formatter:lineResult,
editoptions:{value:":请选择;" + getLine()},stype:"select",searchoptions:{value:":请选择;" + getLine()}},
{name:'linetype',index:'linetype', width:60, sortable:false,editable: true,edittype:"select",editrules:{required:true},formatter:linetypeResult,
editoptions:{value:":请选择;1:单;2:双"},stype:"select",searchoptions:{value:":请选择;1:单;2:双"}},
- bootstrap中时间显示格式问题
- GridView中显示时间日期格式问题
- GridView中显示时间日期格式问题
- GridView中显示时间日期格式问题
- GridView中显示时间日期格式问题
- easyui显示时间格式问题
- GridView中显示时间日期格式等问题
- Java中时间显示格式
- Bootstrap中datepicker时间插件出现问题
- gridview中时间格式问题
- json格式的时间显示问题
- 24小时格式时间显示有关问题
- .NET MVC 时间格式View显示问题
- Bootstrap中Glyphicons 图标不显示问题
- bootstrap中table隐藏后显示问题
- bootstrap中datetimepicker显示1899问题
- bootstrap datepicker 在bootstrap modal中不显示问题
- bootstrap datepicker 在bootstrap modal中不显示问题
- DM368开发 -- 视频监控系统相关技术研究(转毕设)
- Oracle-1
- Android 源码开发去掉弹出的默认程序。
- opencv2 camshift目标跟踪详解及测试代码
- 设计模式 工厂模式 从卖肉夹馍说起
- bootstrap中时间显示格式问题
- Asp.Net学习笔记一:泛型
- 持续集成(Continuous Integration)
- 最简单的基于FFmpeg的内存读写的例子:内存转码器
- 固定电话+手机号码正则表达式
- Leetcode Spiral Matrix II
- python 环境
- css优先级
- 关于maven的使用方式