mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 21:16:22 +00:00
11 lines
394 B
JavaScript
11 lines
394 B
JavaScript
// Validar fechas en navegadores que no soportan date, como
|
|
// Webkit/Safari
|
|
document.addEventListener('turbolinks:load', () => {
|
|
document.querySelectorAll('input[type="date"]').forEach(date => {
|
|
if (date.type === 'date') return
|
|
|
|
date.addEventListener('change', event => {
|
|
date.setCustomValidity(date.validity.patternMismatch ? date.dataset.patternMismatch : '')
|
|
})
|
|
})
|
|
})
|