Skip to content

Instantly share code, notes, and snippets.

@thiamsantos
Created July 25, 2017 20:27
Show Gist options
  • Save thiamsantos/85c312e0695ab7dcc2214d30fe249739 to your computer and use it in GitHub Desktop.
Save thiamsantos/85c312e0695ab7dcc2214d30fe249739 to your computer and use it in GitHub Desktop.
check if browser support input type date
function supportInputDate() {
const type = 'date'
const smile = '1)'
const inputElement = document.createElement('input')
inputElement.setAttribute('type', type)
inputElement.value = smile
inputElement.value !== smile
return inputElement.type === 'date' && inputElement.value !== smile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment