Commit 84b634aa by Alfonso Abella

generateFields WG-484 in progress

parent b1bec4d7
......@@ -274,6 +274,7 @@ const inputString = (key, validation) => {
const {
mandatory,
fieldLength,
validDate,
collection
} = validation
......@@ -378,7 +379,8 @@ const inputDate = (key, validation) => {
try {
const {
mandatory,
fieldLength
fieldLength,
validDate
} = validation
const input = document.createElement('input')
......@@ -388,7 +390,7 @@ const inputDate = (key, validation) => {
input.addEventListener('focusout', handleInput)
mandatory ? input.setAttribute('required', 'true') : null
validDate ? input.setAttribute('validDate',validDate) : null
return input
} catch (err) {
throw err
......@@ -438,7 +440,8 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
try {
const {
mandatory,
fieldLength
fieldLength,
validDate
} = validation
const dateRangePicker = document.createElement('div')
......@@ -458,6 +461,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
input.setAttribute('type', 'date')
input.addEventListener('focusout', handleInput)
mandatory ? input.setAttribute('required', 'true') : null
validDate ? input.setAttribute('validDate',validDate) : null
startDate.setAttribute('class', 'dateContainer')
// "TO" Label
......@@ -470,6 +474,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
input2.setAttribute('type', 'date')
input2.addEventListener('focusout', handleInput)
mandatory ? input2.setAttribute('required', 'true') : null
validDate ? input2.setAttribute('validDate',validDate) : null
endDate.setAttribute('class', 'dateContainer')
dateRangePicker.appendChild(dateRange);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment