datepicker: use only input.date - jscancer - Javascript crap (relatively small)
HTML git clone git://git.codemadness.org/jscancer
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 2f59a2607931adbfda644713662b2eace4c3e220
DIR parent d1a071cccc5a23c1a3a48f826b7e44c1abd53268
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 1 Jun 2017 19:53:45 +0200
datepicker: use only input.date
Diffstat:
M datepicker/datepicker.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
DIR diff --git a/datepicker/datepicker.js b/datepicker/datepicker.js
@@ -207,5 +207,6 @@ function datepicker_init(input) {
if (!(function() { var input = document.createElement("input"); try { input.type = "date"; return (input.type === "date"); } catch(e) {} return false; })()) {
var els = document.getElementsByClassName && document.getElementsByClassName("date") || [];
for (var i = 0; i < els.length; i++)
- datepicker_init(els[i]);
+ if (els[i].tagName.toLowerCase() === "input")
+ datepicker_init(els[i]);
}