From 1f0f5d230b41dd53af6f7a41be8be5d1da5f2c86 Mon Sep 17 00:00:00 2001 From: Ethan Soergel Date: Thu, 16 Mar 2023 11:06:57 -0400 Subject: [PATCH] stickler --- .../static/cloudcare/js/form_entry/spec/entries_spec.js | 3 ++- corehq/apps/cloudcare/static/cloudcare/js/utils.js | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) 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) {