Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/components/ganttchart/ganttChart.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const scales = [
{ unit: "month", step: 1, format: "Y년 M" },
{ unit: "month", step: 1, format: "Y년 M월" },
{ unit: "day", step: 1, format: "d일" },
];

export const columns = [
{ id: "text", header: "작업명", flexGrow: 1, align: "center"},
{ id: "start", header: "마감일", flexGrow: 1, align: "center" },
{ id: "start", header: "시작일", flexGrow: 1, align: "center" },
// { id: "action", header: "", width: 50, align: "center" },
];

Expand Down Expand Up @@ -40,8 +40,7 @@ export const calculateDuration = (start, end) => {
const startDate = new Date(start);
const endDate = new Date(end);
startDate.setHours(0, 0, 0, 0);
endDate.setHours(0, 0, 0, 0);
endDate.setHours(23, 59, 59, 59);
const diffTime = Math.abs(endDate - startDate);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
return diffDays + 1;
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
};
6 changes: 4 additions & 2 deletions src/components/kanban/Kanban.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ function Kanban({ projectId, members = [] }) {
};

const handleAddNewCard = (columnId) => {
// 새 이슈에 대한 기본 날짜 정보를 추가합니다.
const startDate = new Date();
startDate.setHours(0, 0, 0, 0); // 00시 00분 00초 000밀리초

const endDate = new Date();
endDate.setDate(startDate.getDate() + 1); // 기본 마감일은 다음 날로 설정
endDate.setDate(startDate.getDate() + 1); // 다음 날로 설정
endDate.setHours(23, 59, 59, 999); // 23시 59분 59초 999밀리초

const newIssueData = {
title: "새로운 작업",
Expand Down
23 changes: 14 additions & 9 deletions src/components/kanban/KanbanCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,26 @@ function KanbanCard({ item, index, onCardClick, onDelete }) {
};

const formatDate = (dateString) => {
const date = new Date(dateString)
const today = new Date()
const diffTime = date - today
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
const date = new Date(dateString);
const today = new Date();

// 시간 정규화
date.setHours(23, 59, 59, 999); // 대상 날짜는 하루 끝으로
today.setHours(0, 0, 0, 0); // 오늘은 하루 시작으로

const diffTime = date - today;
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));

if (diffDays < 0) {
return `${Math.abs(diffDays)}일 지남`
return `${Math.abs(diffDays)}일 지남`;
} else if (diffDays === 0) {
return '오늘'
return '오늘';
} else if (diffDays === 1) {
return '내일'
return '내일';
} else {
return `${diffDays}일 남음`
return `${diffDays}일 남음`;
}
}
};

return (
<Draggable draggableId={item.id.toString()} index={index}>
Expand Down
11 changes: 5 additions & 6 deletions src/components/project/ProjectFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ function ProjectFilters({ filters, onFiltersChange, sortBy, onSortChange }) {
];

const sortOptions = [
{ value: "created", label: "생성일순" },
{ value: "name", label: "이름순" },
{ value: "progress", label: "진행률순" },
{ value: "endDate", label: "마감일순" },
{ value: "priority", label: "우선순위순" }
{ value: "CREATED_AT", label: "생성일순" },
{ value: "NAME", label: "이름순" },
{ value: "END_DATE", label: "마감일순" },
{ value: "PRIORITY", label: "우선순위순" }
];

return (
Expand Down Expand Up @@ -77,7 +76,7 @@ function ProjectFilters({ filters, onFiltersChange, sortBy, onSortChange }) {
</div>

{/* 필터 초기화 */}
{(filters.status !== 'all' || filters.priority !== 'all' || filters.assignee !== 'all' || filters.period !== 'all') && (
{(filters.status !== 'all' || filters.priority !== 'all') && (
<button
onClick={() => onFiltersChange({
status: 'all',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ProjectManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function ProjectManager() {
const [viewType, setViewType] = useState('card');
const [searchTerm, setSearchTerm] = useState('');
const [filters, setFilters] = useState({ status: 'all', priority: 'all' });
const [sortBy, setSortBy] = useState('created');
const [sortBy, setSortBy] = useState('CREATED_AT');
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
const [selectedProject, setSelectedProject] = useState(null);

const apiFilters = useMemo(() => ({
search: searchTerm,
status: filters.status === 'all' ? null : statusMap[filters.status],
priority: filters.priority === 'all' ? null : priorityMap[filters.priority],
sort: sortBy,
sortBy: sortBy,
}), [searchTerm, filters, sortBy]);

const { data: projectData, isLoading: projectsLoading, isError: projectsError } = useProjects(apiFilters);
Expand Down