발생한 문제:
Firefox에 시간 입력 상자가 여러 개 있는 경우laydate 시간 구성 요소가 첫 번째 입력 상자에만 값을 할당할 수 있는 문제(Safari에서도 동일한 문제가 발생함)
해결책:
laydate에 ID를 바인딩합니다.
해결 전 코드:
<span style="color: #008080;">1</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="startTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入开始时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">2</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span> <span style="color: #008080;">3</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">4</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">5</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="endTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入结束时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">6</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span>
해결된 코드:
<span style="color: #008080;">1</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="startTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入开始时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">2</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({elem: '#startTime', istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span> <span style="color: #008080;">3</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">4</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">5</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="endTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入结束时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">6</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({elem: '#endTime', istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span>
위와 같이 2행과 6행에 ID 바인딩을 추가하면 문제가 해결됩니다.
<span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;"> </span>