Skip to content

Instantly share code, notes, and snippets.

@amitgupta15
Last active April 30, 2020 21:46
Show Gist options
  • Save amitgupta15/80ed6d59a853e70f6ef62a1b3c0baeda to your computer and use it in GitHub Desktop.
Save amitgupta15/80ed6d59a853e70f6ef62a1b3c0baeda to your computer and use it in GitHub Desktop.
Front End Test Blog - app.js
(function () {
'use strict';
// Create a global variable and expose it to the world
var $myapp = {};
self.$myapp = $myapp;
$myapp.isValidDate = function (dateString) {
var dateRegex = /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/gi;
return dateRegex.test(dateString);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment