Skip to content

Commit

Permalink
Added date formats
Browse files Browse the repository at this point in the history
This makes tempus dominus more forgiving about users entering single-digit
months and years, which would previously be rejected as invalid input.
  • Loading branch information
orangejenny committed Jun 25, 2024
1 parent e0f6ea5 commit 0662cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corehq/apps/cloudcare/static/cloudcare/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ hqDefine('cloudcare/js/utils', [
return inputDate;
};

var dateFormat = 'MM/DD/YYYY';
var dateFormats = ['MM/DD/YYYY', 'YYYY-MM-DD', 'M/D/YYYY', 'M/D/YY', 'M-D-YYYY', 'M-D-YY', moment.defaultFormat];
var dateFormat = 'M/D/YYYY';
var dateFormats = ['MM/DD/YYYY', 'M/DD/YYYY', 'MM/D/YYYY', 'YYYY-MM-DD', 'M/D/YYYY', 'M/D/YY', 'M-D-YYYY', 'M-D-YY', moment.defaultFormat];

// Annoyingly, moment and tempus dominus use different formats.
// Moment: https://momentjs.com/docs/#/parsing/string-format/
Expand Down

0 comments on commit 0662cbd

Please sign in to comment.