Created
April 6, 2015 12:28
-
-
Save dan-codes-16/f2bc7b3c9cff1dacef9b to your computer and use it in GitHub Desktop.
Checks if html5 input type date is supported
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = { | |
/** | |
* Checks if html5 input date is supported | |
* | |
* @return {Boolean} True if html5 input date is supported by the client browser | |
*/ | |
isInputDateSupported: function () { | |
var el = document.createElement('input'), | |
fakeValue = 'fake-date'; | |
el.setAttribute('type', 'date'); | |
el.setAttribute('value', fakeValue); | |
return !(el.value === fakeValue); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment