Because it involves a Easyui datetimebox control to display the date, the date format: h-m-s seconds. such as 18:06:32
To format.
Nonsense not much to say on the code.
<inputclass="Easyui-datetimebox"data-options="Formatter:ww4,parser:w4"style="width:200px;"> yyyy mm month dd Day hh Point </input>
<script type="Text/javascript">
function ww4 (date) {
var y = date.getfullyear ();
var m = date.getmonth () +1;
var d = date.getdate ();
var h = date.gethours ();
returny+' Year '+ (m<10? (' 0 '+m): m) +' Month '+ (d<10? (' 0 '+d):d) +' Day '+ (h<10? (' 0 '+h): h) +' point ';
}
-
function w4 (s) {
-
var reg=/[\u4e00-\ u9fa5]/ //uses regular expressions to separate
var ss = (S.split (reg));
var y = parseint (ss[0],10);
var m = parseint (ss[1],10);
var d = parseint (ss[2],10);
var h = parseint (ss[3],10);
if (!isnan (y) &&!isnan (m) &&!isnan (d) &&!isnan (h)) {
-
return new date (Y,m-1,d,h);
-
} else {
return New Date ();
}
}
</script>
year: date.getfullyear ()
months: month
Days: Day
time: date.gethours ()
points: date.getminutes ()
seconds: data.getseconds ()
Easyui datetimebox date format into desired format