博客
关于我
EasyUi对时间格式的处理
阅读量:682 次
发布时间:2019-03-17

本文共 315 字,大约阅读时间需要 1 分钟。

最近使用Easyui的日期框,传送到后台,要传入数据库,一直报错,后发现easyui的日期格式是dd/MM/yyyy,需要转下格式为:yyyy-MM-dd

看easyui的官方文档,有个formatter属性可以修改日期格式,具体代码如下:

  1. html
  1. JS
$("#birthday").datebox({   	formatter: formatDate});function formatDate(date){   	var y = date.getFullYear();	var m = date.getMonth()+1;	var d = date.getDate();	return y+'-'+m+'-'+d;}
  1. 效果
    在这里插入图片描述

转载地址:http://wtuhz.baihongyu.com/

你可能感兴趣的文章
NN&DL4.1 Deep L-layer neural network简介
查看>>
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>