设置datetime的格式,直接有方法重载进行,即使数据为datetime?格式
设置起始时间在配置的时候添加设置
$(‘#closeTime‘).datetimepicker({ language: ‘zh-CN‘, startDate: "2016-01-01 00:00" });
使用的是bootstrap的datetimepicker插件
<link href="@Url.StaticFile("/assets/global/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css")" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="@Url.StaticFile("/assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js")"></script>
<script type="text/javascript" src="@Url.StaticFile("/assets/global/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js")"></script>
$(function () { $(‘#closeTime‘).datetimepicker({ language: ‘zh-CN‘, startDate: "2016-01-01 00:00" }); })
http://www.bootcss.com/p/bootstrap-datetimepicker/demo.htm
时间: 2024-10-17 15:34:49