下面有图,对了还有,可以不要年份吗?望各位大神或者路过的兄弟解答
- 发布:2016-08-24 12:23
- 更新:2017-07-11 22:04
- 阅读:2403
dtpicker如何添加星期上去呢,h5模式
<button id='demo4' data-options='{"type":"date","week":"true","lang":"cn"}' class="btn mui-btn mui-btn-block">选择日期1111 ...</button>
加了二个参数(,"week":"true" 就是显示星期几,否则就保持原样;"lang":"cn" 是显示中字,否则就是保持原样),其它的自己来扩展了。
把附件中的文件替换原来的文件:mui.dtpicker.js
如果不要年份,在如下代码中加入你想要的格式就行:
switch (type) {
case 'datetime':
selected.value = selected.y.value + '-' + selected.m.value + '-' + selected.d.value + ' ' + selected.h.value + ':' + selected.i.value;
selected.text = selected.y.text + cn + selected.m.text + cn + selected.d.text + ' ' + selected.h.text + ':' + selected.i.text;
break;
case 'date':
selected.value = selected.y.value + '-' + selected.m.value + '-' + selected.d.value;
selected.text = selected.y.text + cn + selected.m.text + cn + selected.d.text;
break;
case 'time':
selected.value = selected.h.value + ':' + selected.i.value;
selected.text = selected.h.text + ':' + selected.i.text;
break;
case 'month':
selected.value = selected.y.value + cn + selected.m.value;
selected.text = selected.y.text + cn + selected.m.text;
break;
case 'hour':
selected.value = selected.y.value + cn + selected.m.value + cn + selected.d.value + ' ' + selected.h.value;
selected.text = selected.y.text + cn + selected.m.text + cn + selected.d.text + ' ' + selected.h.text;
break;
}