Skip to content

Commit

Permalink
fix: same start and end dates on DatesInterval component (#394)
Browse files Browse the repository at this point in the history
* RM#75113
  • Loading branch information
vhu-axelor authored Feb 9, 2024
1 parent 3488034 commit 433ffae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

import React, {useMemo} from 'react';
import {StyleSheet, View} from 'react-native';
import {getFullDateItems, useTranslator} from '@axelor/aos-mobile-core';
import {
areObjectsEquals,
getFullDateItems,
useTranslator,
} from '@axelor/aos-mobile-core';
import {Text} from '@axelor/aos-mobile-ui';

interface DateIntervalProps {
Expand All @@ -44,7 +48,7 @@ const DatesInterval = ({startDate, endDate, style}: DateIntervalProps) => {
);

const renderDates = () => {
if (_startDate === _endDate || _endDate == null) {
if (areObjectsEquals(_startDate, _endDate) || _endDate == null) {
// prettier-ignore
return (
<Text>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function areObjectsEquals(object1, object2) {
.toLowerCase()
.includes(stringNoAccent(object2).toLowerCase());
} else {
return object1 === object2;
return JSON.stringify(object1) === JSON.stringify(object2);
}
}
}
Expand Down

0 comments on commit 433ffae

Please sign in to comment.