Update proptypes, use date function
This commit is contained in:
1 parent
b3d16bfa25
commit
1e480a10e0
2 files changed
+5
-8
No files matched your search
@@ -85,9 +85,10 @@ const CustomToolTip = ({ active, payload, label }) => {
|
|||||||
const CustomTick = ({ x, y, payload, index }) => {
|
const CustomTick = ({ x, y, payload, index }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const uiTimezone = useSelector((state) => state.ui.timezone);
|
||||||
|
|
||||||
// Render nothing for the first tick
|
// Render nothing for the first tick
|
||||||
if (index === 0) return null;
|
if (index === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text
|
||||||
x={x}
|
x={x}
|
||||||
@@ -97,11 +98,7 @@ const CustomTick = ({ x, y, payload, index }) => {
|
|||||||
fontSize={11}
|
fontSize={11}
|
||||||
fontWeight={400}
|
fontWeight={400}
|
||||||
>
|
>
|
||||||
{formatDate(new Date(payload.value), {
|
{formatDateWithTz(payload?.value, "HH:mm:ss", uiTimezone)}
|
||||||
year: undefined,
|
|
||||||
month: undefined,
|
|
||||||
day: undefined,
|
|
||||||
})}
|
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ const CustomLabels = ({
|
|||||||
|
|
||||||
CustomLabels.propTypes = {
|
CustomLabels.propTypes = {
|
||||||
x: PropTypes.number.isRequired,
|
x: PropTypes.number.isRequired,
|
||||||
width: PropTypes.number.isRequired,
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
height: PropTypes.number.isRequired,
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||||
firstDataPoint: PropTypes.object.isRequired,
|
firstDataPoint: PropTypes.object.isRequired,
|
||||||
lastDataPoint: PropTypes.object.isRequired,
|
lastDataPoint: PropTypes.object.isRequired,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
|
|||||||
Reference in new issue
Block a user