custom-cleave
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "custom-cleave", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Format for input element", | ||
@@ -5,0 +5,0 @@ "main": "src/custom-cleave.js", |
@@ -12,8 +12,18 @@ const dateFormatter = (options) => { | ||
const targetInput = document.querySelector(`#${id}`); | ||
const targetInput = document.getElementById(`#${id}`); | ||
targetInput.placeholder = "placeholder"; | ||
targetInput.maxLength = 10; | ||
targetInput.setAttribute("type", "tel"); | ||
function addPlaceHolder(type) { | ||
if (type == "y") return "YYYY"; | ||
if (type == "d") return "DD"; | ||
if (type == "m") return "MM"; | ||
} | ||
let plc = ""; | ||
pattern.forEach((type) => { | ||
plc = plc + addPlaceHolder(type) + delimiter; | ||
}); | ||
targetInput.placeholder = plc; | ||
function isLeapYear(year) { | ||
@@ -20,0 +30,0 @@ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4605
141