diff --git a/corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/entries_spec.js b/corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/entries_spec.js index a794fa1611bc..d15a9c655eb5 100644 --- a/corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/entries_spec.js +++ b/corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/entries_spec.js @@ -1,4 +1,5 @@ /* eslint-env mocha */ +/* globals moment */ describe('Entries', function () { var constants = hqImport("cloudcare/js/form_entry/const"), @@ -355,7 +356,7 @@ describe('Entries', function () { }); it('Should fail to interpret invalid date inputs', function () { - let assertInvalid = function (userInput, expected) { + let assertInvalid = function (userInput) { assert.isNull(utils.parseInputDate(userInput)); }; diff --git a/corehq/apps/cloudcare/static/cloudcare/js/utils.js b/corehq/apps/cloudcare/static/cloudcare/js/utils.js index cebeb6a45d6c..003399adfa7e 100644 --- a/corehq/apps/cloudcare/static/cloudcare/js/utils.js +++ b/corehq/apps/cloudcare/static/cloudcare/js/utils.js @@ -372,10 +372,7 @@ hqDefine('cloudcare/js/utils', [ }; var dateFormat = 'MM/DD/YYYY'; - var dateFormats = ['MM/DD/YYYY', 'YYYY-MM-DD', // strict formats first - 'M/D/YYYY', 'M/D/YY', - 'M-D-YYYY', 'M-D-YY', - moment.defaultFormat]; + var dateFormats = ['MM/DD/YYYY', 'YYYY-MM-DD', 'M/D/YYYY', 'M/D/YY', 'M-D-YYYY', 'M-D-YY', moment.defaultFormat]; /** Coerce an input date string to a moment object */ var parseInputDate = function (dateString) {