Skip to content

feat: Add weekendColor prop to highlight weekend columns#2

Open
jeonghanyun wants to merge 1 commit intomainfrom
feature/add-weekend-color-support
Open

feat: Add weekendColor prop to highlight weekend columns#2
jeonghanyun wants to merge 1 commit intomainfrom
feature/add-weekend-color-support

Conversation

@jeonghanyun
Copy link
Copy Markdown
Owner

🎨 Weekend Color Support Feature

이 PR은 MaTeMaTuK/gantt-task-react PR #122의 "Add new prop weekendColor to grid" 기능을 한국어 버전에 적용한 것입니다.

✨ 주요 기능

🗓️ Weekend Highlighting

  • weekendColor prop으로 주말 컬럼에 배경색 적용
  • 토요일(6)과 일요일(0) 자동 감지
  • 투명(transparent) 설정으로 주말 하이라이트 비활성화 가능

🔧 사용 예제

import { Gantt } from 'gantt-task-react';

<Gantt 
  tasks={tasks}
  weekendColor="#97979714"  // 반투명 회색으로 주말 강조
/>

🎯 기능 설명

  • weekendColor: 주말 컬럼의 배경색을 지정
  • 기본값: "transparent" (주말 하이라이트 없음)
  • 예제 색상: "#97979714" (반투명 회색)
  • 동작: 각 날짜의 getDay() 값이 0(일요일) 또는 6(토요일)일 때 색상 적용

📁 변경된 파일들

Core Files

  • src/types/public-types.ts: weekendColor prop을 StylingOption에 추가
  • src/components/grid/grid-body.tsx: 주말 감지 및 색상 적용 로직
  • src/components/gantt/gantt.tsx: weekendColor prop 전달

Example Files

  • example/src/App.tsx: weekendColor 사용 예제 추가

Documentation

  • README.md: weekendColor 문서 추가

🔄 기타 변경사항

  • todayColor 기본값을 rgba(252, 248, 227, 0.5)에서 rgba(252, 248, 227, 1)로 변경 (원본 PR과 동일)

✅ 테스트

  • 빌드 성공
  • 주말 컬럼 하이라이트 동작 확인
  • TypeScript 타입 검증

🙏 Credit

Original PR by @AquilesOliveiraDev - PR #122

이 기능으로 주말에 특별한 규칙이 적용되는 프로젝트에서 시각적으로 주말을 구분할 수 있게 되었습니다! 🎉

- Add weekendColor prop to StylingOption interface
- Add weekendColor support in GridBodyProps and GridBody component
- Implement weekend detection logic using getDay() (0=Sunday, 6=Saturday)
- Add weekend column highlighting with configurable color
- Update Gantt component to accept and pass weekendColor prop
- Add weekendColor usage examples in example app (#97979714)
- Update README.md with weekendColor documentation
- Change todayColor default from rgba(252, 248, 227, 0.5) to rgba(252, 248, 227, 1)

Based on PR MaTeMaTuK#122 from MaTeMaTuK/gantt-task-react by AquilesOliveiraDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant