升级easyUI到1.9.4版本
This commit is contained in:
45
erp_web/js/easyui/demo/datebox/dateformat.html
Normal file
45
erp_web/js/easyui/demo/datebox/dateformat.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Date Format - jQuery EasyUI Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="../demo.css">
|
||||
<script type="text/javascript" src="../../jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Date Format</h2>
|
||||
<p>Different date formats are applied to different DateBox components.</p>
|
||||
<div style="margin:20px 0;"></div>
|
||||
<div class="easyui-panel" style="width:100%;max-width:400px;padding:30px 60px;">
|
||||
<div style="margin-bottom:20px">
|
||||
<input class="easyui-datebox" label="Default Format:" labelPosition="top" style="width:100%;">
|
||||
</div>
|
||||
<div style="margin-bottom:20px">
|
||||
<input class="easyui-datebox" label="Customized Format:" labelPosition="top" data-options="formatter:myformatter,parser:myparser" style="width:100%;">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function myformatter(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
|
||||
}
|
||||
function myparser(s){
|
||||
if (!s) return new Date();
|
||||
var ss = (s.split('-'));
|
||||
var y = parseInt(ss[0],10);
|
||||
var m = parseInt(ss[1],10);
|
||||
var d = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user