Home >Web Front-end >Layui Tutorial >How to modify the layui date start and end time selector to 1900 after resetting it
layui date start and end time selector is modified to 1900 after reset
Question: How to modify layui date start and end time selector to be reset to 1900?
Solution:
<code class="javascript">layui.laydate.render({ elem: '#开始时间', type: 'datetime', startTime: '2012-01-01 00:00:00' // 修改为起始时间 });</code>
<code class="javascript">layui.laydate.render({ elem: '#结束时间', type: 'datetime', endTime: '2023-12-31 23:59:59' // 修改为结束时间 });</code>
<code class="javascript">layui.laydate.render({ elem: '#日期范围', type: 'datetime', range: true, value: '2022-03-01 00:00:00 ~ 2022-03-31 23:59:59' // 设置初始范围值 });</code>
Note:
yyyy-MM-dd HH:mm:ss
. range
parameter, the value
parameter must be a combination of two time ranges, separated by ~
. The above is the detailed content of How to modify the layui date start and end time selector to 1900 after resetting it. For more information, please follow other related articles on the PHP Chinese website!