Skip to content

Commit

Permalink
fix: 🐛 handle datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Pryka committed Jul 14, 2020
1 parent a8ba8d4 commit aa16a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/js/app/queryCreator/components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ const Filters: FC<Props> = ({ collection, filters, onChange }) => {
variant="solid"
placeholder={'Select property type'}
options={dataTypes}
onChange={({ type }: { type: PropertyType }) => {
filtersDispatcher(updateFilter(idx, { propertyType: type }));
setDefaults(idx, type, item?.propertyValue );
onChange={(type) => {
filtersDispatcher(updateFilter(idx, { propertyType: type.value }));
setDefaults(idx, type.value, item?.propertyValue );

if (item?.operator) {
const operatorOptions = getOperatorOptions(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const DATE_FORMAT = 'YYYY-MM-DD';
const TIME_FORMAT = 'HH:mm';

export const convertDateToString = (valueSelected) => {
const value = valueSelected || moment(moment().format(DATE_FORMAT));
const value = moment(valueSelected).isValid() ? valueSelected : moment(moment().format(DATE_FORMAT));
const valueConverted = `${moment(value).format(DATE_FORMAT)}T${moment(value).format(
TIME_FORMAT
)}:00.000Z`;
Expand Down

0 comments on commit aa16a98

Please sign in to comment.