input type=date时,时间数据回填,报错The specified value "2019-0404-18" does not conform to the required format...

<input autocomplete  id="start-time" name="start_time" type="date"
                                   class="glyphicon glyphicon-calendar col-sm-2 form-control" @if(!empty($orderInfo)) value="{{date('Y-m-d',strtotime($orderInfo->start_time))}}" @endif required="required" placeholder="合同开始时间">
                            <p></p>

                            <input autocomplete  id="due-time" name="duetime" type="date"
                                   class="glyphicon glyphicon-calendar col-sm-2 form-control" @if(!empty($orderInfo)) value="{{date('Y-m-d',strtotime($orderInfo->duetime))}}" @endif required="required" placeholder="合同结束时间">

                            <p style="color:#ff3b4c">到期时间不能早于开始时间</p>

The specified value "2019-0404-18" does not conform to the required format, "yyyy-MM-dd". 

 报错信息:指定值“2019-0404-18”不符合要求的格式“YYYY-MM-DD”。

更换为:将 ‘/’,换为 ‘-’

{{date('Y-m-d',strtotime($orderInfo->duetime))}}
posted @ 2022-01-26 18:12  码农编程进阶笔记  阅读(303)  评论(0编辑  收藏  举报
返回顶部 有事您Q我