본문 바로가기
프로그래밍/Web.

[HTML] IE에서 Date 타입 미지원 현상 해결

by _Chavi 2020. 3. 9.

 

HTML5에서 사용하는 <input type="date"/>가 IE에서 지원하지 않습니다.

출처 : MDN web docs(https://developer.mozilla.org/ko/docs/Web/HTML/Element/input/date)

 

해결
<!-- cdn for modernizr, if you haven't included it already -->
<script src="http://cdn.jsdelivr.net/webshim/1.12.4/extras/modernizr-custom.js"></script>
<!-- polyfiller file to detect and load polyfills -->
<script src="http://cdn.jsdelivr.net/webshim/1.12.4/polyfiller.js"></script>
<script>
  webshims.setOptions('waitReady', false);
  webshims.setOptions('forms-ext', {types: 'date'});
  webshims.polyfill('forms forms-ext');
</script>

<!-- 출처 : https://stackoverflow.com/questions/22983013/how-to-get-html-5-input-type-date-working-in-firefox-and-or-ie-10/29189572#29189572 --!>

관련 내용을 검색하던 중 StackOverflow에서 위와 같은 답변을 찾았습니다.

해당 페이지에 추가하여주시고 입력창 부분은 기존에 사용하시던 대로 사용하시면 됩니다.

가장 간단하고 괜찮은 해결법인 것 같습니다.

 

댓글