UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: маркер текущего дня в Ганте главной
This commit is contained in:
@@ -148,6 +148,14 @@ const getTimelineTicks = (startDate: Date, endDate: Date, dayWidth: number, step
|
||||
});
|
||||
};
|
||||
|
||||
const getShortDateLabel = (date: Date, locale: string) =>
|
||||
new Intl.DateTimeFormat(locale || "ru-RU", {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
})
|
||||
.format(date)
|
||||
.toUpperCase();
|
||||
|
||||
export function GanttTimelinePreview(props: TGanttTimelinePreviewProps) {
|
||||
const { emptyMessage, isLoading = false, items, locale, subtitle, title } = props;
|
||||
const [activeRange, setActiveRange] = useState<TGanttPreviewRange>("Live");
|
||||
@@ -204,6 +212,7 @@ export function GanttTimelinePreview(props: TGanttTimelinePreviewProps) {
|
||||
blocks,
|
||||
canvasWidth,
|
||||
ticks: getTimelineTicks(startDate, endDate, settings.dayWidth, settings.tickStepDays, locale),
|
||||
todayLabel: getShortDateLabel(today, locale),
|
||||
timelineWidth,
|
||||
todayLeft: getDaysBetween(startDate, today) * settings.dayWidth,
|
||||
};
|
||||
@@ -270,7 +279,9 @@ export function GanttTimelinePreview(props: TGanttTimelinePreviewProps) {
|
||||
<span>{tick.label}</span>
|
||||
</div>
|
||||
))}
|
||||
<div className="nodedc-home-gantt-today-line" style={{ left: `${timeline.todayLeft}px` }} />
|
||||
<div className="nodedc-home-gantt-today-marker" style={{ left: `${timeline.todayLeft}px` }}>
|
||||
<span className="nodedc-home-gantt-today-pill">Сегодня · {timeline.todayLabel}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={cn("relative z-[1] space-y-3 pt-12", { "space-y-2": isCompactMode })}>
|
||||
|
||||
Reference in New Issue
Block a user