【LayUI】laydate.render报错:日期格式不合法

问题描述:

laydate显示日期时提示:日期格式不合法

//渲染日期
laydate.render({
    elem: '#txtBeginTime',
    type: 'datetime'
});

解决方案:

格式化日期,与laydate格式保持一致

this.txtBeginTime.Value = dtSeckill.Rows[0]["BeginTime"] is DBNull ? "" : Convert.ToDateTime(dtSeckill.Rows[0]["BeginTime"]).ToString("yyyy-MM-dd HH:mm:ss");

 

posted @ 2021-04-13 11:04  智者见智  阅读(3015)  评论(0编辑  收藏  举报