Skip to content

Commit

Permalink
stickler
Browse files Browse the repository at this point in the history
  • Loading branch information
esoergel committed Mar 16, 2023
1 parent 04cb40b commit 1f0f5d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-env mocha */
/* globals moment */

describe('Entries', function () {
var constants = hqImport("cloudcare/js/form_entry/const"),
Expand Down Expand Up @@ -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));
};

Expand Down
5 changes: 1 addition & 4 deletions corehq/apps/cloudcare/static/cloudcare/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1f0f5d2

Please sign in to comment.