From d8cd04bfb2e287f109f55e07235d8cc77a4658d1 Mon Sep 17 00:00:00 2001 From: wade Date: Fri, 5 Jul 2024 16:42:08 +0900 Subject: [PATCH 01/16] test commit --- src/components/calendar/calendar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index a5860db52..311438201 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -225,6 +225,7 @@ export const Calendar: React.FC = ({ .getDate() .toString()}`; + console.log(bottomValue); bottomValues.push( Date: Fri, 5 Jul 2024 16:54:01 +0900 Subject: [PATCH 02/16] =?UTF-8?q?=ED=95=9C=EA=B5=AD=EC=8B=9D=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/calendar/calendar.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index 311438201..6f6db99f7 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -176,10 +176,10 @@ export const Calendar: React.FC = ({ let topValue = ""; if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) { // top - topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`; + topValue = `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}`; } // bottom - const bottomValue = `W${getWeekNumberISO8601(date)}`; + const bottomValue = `${getWeekNumberISO8601(date)}주`; bottomValues.push( = ({ const dates = dateSetup.dates; for (let i = 0; i < dates.length; i++) { const date = dates[i]; - const bottomValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date + const bottomValue = `${date .getDate() - .toString()}`; + .toString()}일 (${getLocalDayOfWeek(date, locale, "short")})`; - console.log(bottomValue); bottomValues.push( = ({ ); if (i === 0 || date.getDate() !== dates[i - 1].getDate()) { - const topValue = `${getLocalDayOfWeek( + const topValue = `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( date, locale, "short" - )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; + )})`; topValues.push( = ({ ); if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) { const displayDate = dates[i - 1]; - const topValue = `${getLocalDayOfWeek( + const topValue = `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( displayDate, locale, "long" - )}, ${displayDate.getDate()} ${getLocaleMonth(displayDate, locale)}`; + )})`; const topPosition = (date.getHours() - 24) / 2; topValues.push( Date: Fri, 5 Jul 2024 17:15:41 +0900 Subject: [PATCH 03/16] add condition 'ko' The Korean way of expressing dates is very different from English. --- src/components/calendar/calendar.tsx | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index 6f6db99f7..b842a0737 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -176,7 +176,12 @@ export const Calendar: React.FC = ({ let topValue = ""; if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) { // top - topValue = `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}`; + if(locale.includes('ko')) { + topValue = `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}`; + } + else{ + topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`; + } } // bottom const bottomValue = `${getWeekNumberISO8601(date)}주`; @@ -221,9 +226,10 @@ export const Calendar: React.FC = ({ const dates = dateSetup.dates; for (let i = 0; i < dates.length; i++) { const date = dates[i]; - const bottomValue = `${date - .getDate() - .toString()}일 (${getLocalDayOfWeek(date, locale, "short")})`; + const bottomValue = locale.includes('ko') ? `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}` + : + `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`; + bottomValues.push( = ({ ); if (i === 0 || date.getDate() !== dates[i - 1].getDate()) { - const topValue = `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( + const topValue = locale.includes('ko') ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( + date, + locale, + "short" + )})` : `${getLocalDayOfWeek( date, locale, "short" - )})`; + )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; topValues.push( = ({ ); if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) { const displayDate = dates[i - 1]; - const topValue = `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( + const topValue = locale.includes('ko') ? `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( displayDate, locale, "long" - )})`; + )})` : `${getLocalDayOfWeek( + date, + locale, + "long" + )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; const topPosition = (date.getHours() - 24) / 2; topValues.push( Date: Fri, 5 Jul 2024 17:17:10 +0900 Subject: [PATCH 04/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9191d87ba..661236023 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# gantt-task-react +# gantt-task-react (한국식 날짜 표기 적용) ## Interactive Gantt Chart for React with TypeScript. From 696da59fe357bdfaa466a7340f180cd756da9339 Mon Sep 17 00:00:00 2001 From: wade Date: Fri, 5 Jul 2024 17:26:00 +0900 Subject: [PATCH 05/16] add condition 'ko' The Korean way of expressing dates is very different from English. --- src/components/calendar/calendar.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index b842a0737..3a377fef8 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -32,6 +32,7 @@ export const Calendar: React.FC = ({ fontFamily, fontSize, }) => { + console.log("locale", locale); const getCalendarValuesForYear = () => { const topValues: ReactChild[] = []; const bottomValues: ReactChild[] = []; @@ -176,7 +177,7 @@ export const Calendar: React.FC = ({ let topValue = ""; if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) { // top - if(locale.includes('ko')) { + if(locale === 'kor') { topValue = `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}`; } else{ @@ -226,7 +227,7 @@ export const Calendar: React.FC = ({ const dates = dateSetup.dates; for (let i = 0; i < dates.length; i++) { const date = dates[i]; - const bottomValue = locale.includes('ko') ? `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}` + const bottomValue = locale === 'kor' ? `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}` : `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`; @@ -292,7 +293,7 @@ export const Calendar: React.FC = ({ ); if (i === 0 || date.getDate() !== dates[i - 1].getDate()) { - const topValue = locale.includes('ko') ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( + const topValue = locale === 'kor' ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( date, locale, "short" @@ -342,7 +343,7 @@ export const Calendar: React.FC = ({ ); if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) { const displayDate = dates[i - 1]; - const topValue = locale.includes('ko') ? `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( + const topValue = locale === 'kor' ? `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( displayDate, locale, "long" From 7a37466790c7635d5bbc05a106907018babac220 Mon Sep 17 00:00:00 2001 From: wade Date: Fri, 5 Jul 2024 17:56:17 +0900 Subject: [PATCH 06/16] fix missing week --- src/components/calendar/calendar.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index 3a377fef8..e8caee676 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -32,7 +32,6 @@ export const Calendar: React.FC = ({ fontFamily, fontSize, }) => { - console.log("locale", locale); const getCalendarValuesForYear = () => { const topValues: ReactChild[] = []; const bottomValues: ReactChild[] = []; @@ -185,7 +184,7 @@ export const Calendar: React.FC = ({ } } // bottom - const bottomValue = `${getWeekNumberISO8601(date)}주`; + const bottomValue = locale === 'kor' ? `${getWeekNumberISO8601(date)}주` : `W${getWeekNumberISO8601(date)}`; bottomValues.push( Date: Fri, 5 Jul 2024 18:02:24 +0900 Subject: [PATCH 07/16] fix getCalendarValuesForDay --- src/components/calendar/calendar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index e8caee676..b1b0fbc01 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -226,7 +226,11 @@ export const Calendar: React.FC = ({ const dates = dateSetup.dates; for (let i = 0; i < dates.length; i++) { const date = dates[i]; - const bottomValue = locale === 'kor' ? `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}` + const bottomValue = locale === 'kor' ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( + date, + locale, + "short" + )})` : `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`; From e23b2723658e199e787fddf5fc0714f5f0f38012 Mon Sep 17 00:00:00 2001 From: wade Date: Thu, 11 Jul 2024 14:48:48 +0900 Subject: [PATCH 08/16] disable scrollbar css --- src/components/other/horizontal-scroll.module.css | 13 ++++--------- src/components/other/vertical-scroll.module.css | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/other/horizontal-scroll.module.css b/src/components/other/horizontal-scroll.module.css index dcf787e52..56c72b355 100644 --- a/src/components/other/horizontal-scroll.module.css +++ b/src/components/other/horizontal-scroll.module.css @@ -6,9 +6,9 @@ /*iPad*/ height: 1.2rem; } -.scrollWrapper::-webkit-scrollbar { - width: 1.1rem; - height: 1.1rem; +/* .scrollWrapper::-webkit-scrollbar { + width: 10px !important; + height: 10px !important; } .scrollWrapper::-webkit-scrollbar-corner { background: transparent; @@ -25,9 +25,4 @@ background: rgba(0, 0, 0, 0.3); background: var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3)); background-clip: padding-box; -} -@media only screen and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) { -} -.scroll { - height: 1px; -} +} */ diff --git a/src/components/other/vertical-scroll.module.css b/src/components/other/vertical-scroll.module.css index da55a2e2e..33f0bf5ab 100644 --- a/src/components/other/vertical-scroll.module.css +++ b/src/components/other/vertical-scroll.module.css @@ -5,7 +5,7 @@ /*firefox*/ scrollbar-width: thin; } -.scroll::-webkit-scrollbar { +/* .scroll::-webkit-scrollbar { width: 1.1rem; height: 1.1rem; } @@ -24,4 +24,4 @@ background: rgba(0, 0, 0, 0.3); background: var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3)); background-clip: padding-box; -} +} */ From 45e42869d27d5365838e56a8ce7082a427044ffb Mon Sep 17 00:00:00 2001 From: wade Date: Thu, 18 Jul 2024 18:20:46 +0900 Subject: [PATCH 09/16] commit --- package-lock.json | 4 +- src/components/calendar/calendar.tsx | 237 ++++++++++++------ .../other/horizontal-scroll.module.css | 23 -- .../other/vertical-scroll.module.css | 22 -- 4 files changed, 159 insertions(+), 127 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeca7dc81..46dbdfe5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gantt-task-react", - "version": "0.3.8", + "version": "0.3.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gantt-task-react", - "version": "0.3.8", + "version": "0.3.9", "license": "MIT", "devDependencies": { "@testing-library/jest-dom": "^5.16.4", diff --git a/src/components/calendar/calendar.tsx b/src/components/calendar/calendar.tsx index b1b0fbc01..aa1ff1f6d 100644 --- a/src/components/calendar/calendar.tsx +++ b/src/components/calendar/calendar.tsx @@ -40,14 +40,24 @@ export const Calendar: React.FC = ({ const date = dateSetup.dates[i]; const bottomValue = date.getFullYear(); bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if ( i === 0 || @@ -129,14 +139,24 @@ export const Calendar: React.FC = ({ const date = dateSetup.dates[i]; const bottomValue = getLocaleMonth(date, locale); bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if ( i === 0 || @@ -176,25 +196,37 @@ export const Calendar: React.FC = ({ let topValue = ""; if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) { // top - if(locale === 'kor') { + if (locale === "kor") { topValue = `${date.getFullYear()}년 ${getLocaleMonth(date, locale)}`; - } - else{ + } else { topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`; } } // bottom - const bottomValue = locale === 'kor' ? `${getWeekNumberISO8601(date)}주` : `W${getWeekNumberISO8601(date)}`; + const bottomValue = + locale === "kor" + ? `${getWeekNumberISO8601(date)}주` + : `W${getWeekNumberISO8601(date)}`; bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if (topValue) { @@ -226,24 +258,39 @@ export const Calendar: React.FC = ({ const dates = dateSetup.dates; for (let i = 0; i < dates.length; i++) { const date = dates[i]; - const bottomValue = locale === 'kor' ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( - date, - locale, - "short" - )})` - : - `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`; - + const bottomValue = + locale === "kor" + ? `${getLocaleMonth( + date, + locale + )} ${date.getDate()}일 (${getLocalDayOfWeek( + date, + locale, + "short" + )})` + : `${getLocalDayOfWeek(date, locale, "short")}, ${date + .getDate() + .toString()}`; bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if ( i + 1 !== dates.length && @@ -285,26 +332,41 @@ export const Calendar: React.FC = ({ }).format(date); bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if (i === 0 || date.getDate() !== dates[i - 1].getDate()) { - const topValue = locale === 'kor' ? `${getLocaleMonth(date, locale)} ${date.getDate()}일 (${getLocalDayOfWeek( - date, - locale, - "short" - )})` : `${getLocalDayOfWeek( - date, - locale, - "short" - )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; + const topValue = + locale === "kor" + ? `${getLocaleMonth( + date, + locale + )} ${date.getDate()}일 (${getLocalDayOfWeek( + date, + locale, + "short" + )})` + : `${getLocalDayOfWeek( + date, + locale, + "short" + )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; topValues.push( = ({ }).format(date); bottomValues.push( - - {bottomValue} - + + + + {bottomValue} + + ); if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) { const displayDate = dates[i - 1]; - const topValue = locale === 'kor' ? `${getLocaleMonth(displayDate, locale)} ${displayDate.getDate()}일 (${getLocalDayOfWeek( - displayDate, - locale, - "long" - )})` : `${getLocalDayOfWeek( - date, - locale, - "long" - )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; + const topValue = + locale === "kor" + ? `${getLocaleMonth( + displayDate, + locale + )} ${displayDate.getDate()}일 (${getLocalDayOfWeek( + displayDate, + locale, + "long" + )})` + : `${getLocalDayOfWeek( + date, + locale, + "long" + )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`; const topPosition = (date.getHours() - 24) / 2; topValues.push(