zui框架配置日期控件只显示年月
zui框架配置日期控件datetimepicker只显示年月
<!DOCTYPE html>
<head>
<script src="~/Scripts/jquery-1.11.3.min.js"></script>
<script src="~/res/zui-1.9.1-dist/dist/js/zui.min.js"></script>
<script src="~/res/zui-1.9.1-dist/dist/js/zui.lite.min.js"></script>
<script src="~/res/zui-1.9.1-dist/dist/lib/datetimepicker/datetimepicker.min.js"></script>
<link href="~/res/zui-1.9.1-dist/dist/css/zui.min.css" rel="stylesheet" />
<link href="~/res/zui-1.9.1-dist/dist/css/zui.lite.min.css" rel="stylesheet" />
<link href="~/res/zui-1.9.1-dist/dist/css/zui-theme.min.css" rel="stylesheet" />
<link href="~/res/zui-1.9.1-dist/dist/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet" />
</head>
<script>
window.onload = function () {
var now = new Date();//当前时间
var todayDay = myformatter(now);//根据自己的时间展现需要来格式化成相关的格式
$(".form-date").datetimepicker({
language: "zh-CN",//用于月份和月份名称的语言的两个字母代码,英语("en")、德语("de")、巴西语("br")和西班牙语("es"),如果给出未知语言代码,将使用英语。
weekStart: 1,//周一为第一天
todayBtn: 1,//显示今天按钮
autoclose: 1,//选择日期后自动关闭
todayHighlight: 0,
startView: 3,//0 1小时内,1天内,2一月内,3 1-12月,4 ,10年内
minView: 3,//开始显示1-12月
maxView: 4,//最大显示10年内
forceParse: 1,//强制分析
format: 'yyyy-mm',//选择时间格式
}).val(todayDay);//初始化日期
};
function myformatter(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
return y+'-'+(m<10?('0'+m):m);
}
</script>
<html>
<body>
<table>
<tr>
<td>
<input type="text" class="form-control form-date" value="" style="text-align:center;width:100px" readonly="readonly">
</td>
</tr>
</table>
</body>
</html>
zui框架配置日期控件只显示年月的更多相关文章
- ExtJs4.0日期控件只显示年月按年月格式会跳月的解决办法
如果是Ext.form.panel的话,只要设置一下属性就可以.如下代码: { text : '期间', width : 80, sortable : true, dataIndex : 'accou ...
- WPF DatePicker日期控件只显示年月
1.需要引用2个类,第一个类DatePickerCalendar public class DatePickerCalendar { public static readonly Dependency ...
- Ext5.1日期控件仅显示年月
1.注册xtype类型 2.保存文件为xxxx.js 3.使用 xtype : monthfield return this.buildToolbar({ items: [ { xtype: 'mon ...
- js 日期控件 可以显示为和历
日期控件的js <!-- /** * Calendar * @param beginYear 1990 * @param endYear 2010 * @param language 0(zh_ ...
- js ui框架 My97日期控件 富文本编辑器
My97日期控件 http://www.my97.net/dp/index.asp 富文本编辑器 http://www.kindsoft.net/demo.php 百度的magic也不错 http:/ ...
- bootstrap的datetimepicker控件只选择年月的配置
<script src="{% static "jquery/jquery-1.11.3.min.js" %}"></script> & ...
- MY97 日期控件只输入今天之前的值
<script type="text/javascript"> function GetDate() { ...
- JavaScript-自制日历控件(只选择年月)
<style> *{margin: 0px; padding: 0px;} </style> <input type="text" name=&quo ...
- easyui datebox 扩展 只显示年月
http://blog.csdn.net/zhaobao110/article/details/47755445 一个日期控件只显示年月是很正常的事情.可是easyui datebox 不支持这种格式 ...
随机推荐
- JMeter使用代理进行录制
参考: http://www.cnblogs.com/zhuque/archive/2012/11/13/2767747.html JMeter支持第三方(Badboy)录制和代理录制,Badboy录 ...
- 2019nc#3
题号 标题 已通过代码 题解/讨论 通过率 团队的状态 A Graph Games 点击查看 进入讨论 18/292 未通过 B Crazy Binary String 点击查看 1107/3615 ...
- gym/101873/GCPC2017
题目链接:https://codeforces.com/gym/101873 C. Joyride 记忆化搜索形式的dp #include <algorithm> #include < ...
- luogu- P1373 小a和uim之大逃离 DP 四维,其中一维记录差值
P1373 小a和uim之大逃离: https://www.luogu.org/problemnew/show/P1373 题意: 在一个矩阵中,小A和小B轮流取数,小A可以从任意点先取,小B后取,最 ...
- 杭电多校第二场 hdu 6315 Naive Operations 线段树变形
Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Other ...
- asp net core mvc 跨域ajax解决方案
1.配置服务端 在Startup文件中国配置Cors策略: IEnumerable<Client> clients= Configuration.GetSection("Clie ...
- 漫谈Spring Security 在Spring Boot 2.x endpoints中的应用(一)
Spring Boot 2.x极大简化了默认的安全配置,并不是说有很多安全相关的配置,现在你只需要提供一个WebSecurityConfigurerAdapter继承类这样一个简单的操作,Spring ...
- TypeScript模块系统、命名空间、声明合并
命名空间 命名空间能有效避免全局污染.在ES6引入模块之后,命名空间就较少被提及了.如果使用了全局的类库,命名空间仍是一个好的解决方案. namespace Shape{ const pi = Mat ...
- vue项目集成金格WebOffice2015
下载 官网地址:http://www.goldgrid.com/jinge_download/index.aspx?num=5 解压后的文件 js文件中有两个重要的js文件iWebOffice2015 ...
- FreeSql (十一)更新数据 Where
var connstr = "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;" + "Initia ...