Skip to content

Commit

Permalink
[Fix #237] Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope committed Nov 16, 2023
1 parent 1d7dcae commit 59bc883
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/answer/DateTimeAnswer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ const DateTimeAnswer = (props) => {

// workaround because it is not possible to construct Date only with time
let value;
if ((isTime || isDate) && props.value && props.value !== "0") {
if (isTime && props.value && props.value !== "0") {
value = new Date(`0 ${props.value}`);
} else if (isDate && props.value && props.value !== "0") {
value = new Date(props.value);
} else value = null;
} else value = new Date();

// DatePicker does not know dateFormat "x", translate to datetime
const datePickerFormat =
Expand Down
2 changes: 1 addition & 1 deletion src/components/answer/TypeaheadAnswer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { IntelligentTreeSelect } from "intelligent-tree-select/lib/components/In
import "intelligent-tree-select/lib/styles.css";

const processTypeaheadOptions = (options, intl) => {
if (!options) {
if (!options || !options.length) {
return [];
}

Expand Down

0 comments on commit 59bc883

Please sign in to comment.