Skip to content

Conversation

@jeonghanyun
Copy link
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.

2 participants