-
-
Save Om4ar/153ea49dffb51401fb44e1b465525658 to your computer and use it in GitHub Desktop.
Javascript is empty function
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
// Current value is empty | |
this.isEmpty = function(value){ | |
return value == null // NULL value | |
|| value == undefined // undefined | |
|| value == 'undefined' // undefined | |
|| value.length == 0 // Array is empty | |
|| value == '00000000-0000-0000-0000-000000000000' // Guid empty | |
|| ((value instanceof Date && !isNaN(value.valueOf())) // Validate DateTime value and check min-max value | |
&& ((value <= new Date(1753, 01, 01)) // SQL DateTime minimum value | |
|| (value >= new Date(9999, 12, 31, 23, 59, 59, 999))) // SQL DateTime maximum value | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment