BUR-64 синхронизировал изменение input date/time полей с масштабированием графика.

This commit is contained in:
Первов Артем
2026-07-05 13:46:51 +03:00
parent 4e3cc0eb33
commit 8bb19f3f9d
2 changed files with 13 additions and 2 deletions

View File

@@ -4,8 +4,9 @@ import { useRef } from 'react';
import { CalendarDays, CalendarClock, Check, ChevronDown, Clock3, DatabaseZap, Search } from 'lucide-react';
import type { CurrentItem } from '../../../entities/current/types';
import { HistoryChart } from '../../../features/history-chart/HistoryChart';
import type { HistoryZoomRange } from '../../../features/history-chart/chartTypes';
import { RANGE_PRESETS, createRange, type DateRangeState } from '../../../features/history/dateRange';
import { toIsoFromInput } from '../../../utils/format';
import { toInputDateTimeValue, toIsoFromInput } from '../../../utils/format';
import type { HistoryGranularity } from '../../../utils/historyGranularity';
type ArchiveViewProps = {
@@ -108,6 +109,12 @@ export function ArchiveView({
[rangePart]: updateRangeInputPart(range[rangePart], inputPart, value),
});
};
const updateRangeFromZoom = (nextRange: HistoryZoomRange) => {
onRangeChange({
from: toInputDateTimeValue(new Date(nextRange.from)),
to: toInputDateTimeValue(new Date(nextRange.to)),
});
};
return (
<section className="chart-section chart-section--archive">
@@ -263,6 +270,7 @@ export function ArchiveView({
labelFormat={historyAxis.labelFormat}
tags={selectedTags}
tagLabels={tagLabels}
onZoomRangeChange={updateRangeFromZoom}
/>
) : (
<div className="chart-placeholder">Разверните список показателей и выберите серию для графика</div>