fix(project): 타임라인 드래그를 날짜 칸 단위로(반나절에 걸리던 문제) — snap 을 가장 가까운 날 0시로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 14:42:45 +09:00
parent 6dfc6109a4
commit 52c1b004e6
7 changed files with 18 additions and 10 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260929f" />
<link rel="stylesheet" href="/static/project.css?v=20260929g" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260929f" />
<link rel="stylesheet" href="/static/project.css?v=20260929g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260929f" defer></script>
<script src="/static/project.js?v=20260929g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260929f" />
<link rel="stylesheet" href="/static/project.css?v=20260929g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260929f" defer></script>
<script src="/static/project.js?v=20260929g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260929f" />
<link rel="stylesheet" href="/static/project.css?v=20260929g" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -491,5 +491,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260929f" defer></script>
<script src="/static/project.js?v=20260929g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260929f" />
<link rel="stylesheet" href="/static/project.css?v=20260929g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260929f" defer></script>
<script src="/static/project.js?v=20260929g" defer></script>
{% endblock %}
+7
View File
@@ -3385,6 +3385,13 @@
margin: { item: Math.round(8 * tz) },
// 먼저 눌러 선택하지 않아도 바로 끌어서 옮긴다(vis 기본은 선택된 것만 끌림).
itemsAlwaysDraggable: { item: canManage, range: canManage },
// 끌 때 날짜 칸 단위로만 움직인다 — 가장 가까운 날 0시에 붙인다(vis 기본은 반나절 단위라
// 칸 가운데에 걸렸다가 놓으면 다음 날로 넘어갔다). 저장도 onMove 가 일 단위로 한다.
snap: function (date) {
const d = new Date(new Date(date).getTime() + 12 * 3600000);
d.setHours(0, 0, 0, 0);
return d;
},
format: {
minorLabels: function (date, scale) {
const d = new Date(date.valueOf());
+2 -1
View File
@@ -202,7 +202,8 @@
- **타임라인** — vis-timeline(간트형). 기간 있는 작업만. 카드의 하위 작업은 개수(`N ⤷`, 말풍선 "하위 작업 N개")만
— 펼치기 버튼은 없앴다(`tlToggleSubs`·하위 작업 카드 코드는 남아 있지만 여는 곳이 없다). 설명이 있으면 `.pj-tli-desc`. 카드는 선택 없이 바로 끌어 날짜 이동
(`itemsAlwaysDraggable`, 펼친 하위 작업 카드 포함) — `onMove` 는 끈 거리를 **일 단위로 반올림해 원래
날짜에 더한다**(시각 유지, vis 스냅이 반나절 단위라 놓은 자리 날짜를 자르면 하루 모자람). 카드의
날짜에 더한다**(시각 유지). 끄는 동안도 `snap` 옵션으로 가장 가까운 날 0시에 붙여 칸 단위로만 움직인다
(vis 기본 스냅은 반나절 단위라 칸 가운데에 걸렸다). 카드의
**작업 이름(`.pj-tli-name`)을 누르면 오른쪽 작업 창**(`timeline.on("click")`, 누른 뒤 5px 넘게
움직였으면 끌기로 보고 무시 — 끌고 놓으면 브라우저가 click 을 보낸다). 선택된 막대 위 vis 의
`.vis-drag-center` 층은 `pointer-events:none`(이름 클릭이 닿게). 처음 보기 범위는 **하루 칸 = 날짜