10만개가 넘는 달력 데이터,구독해 달력에 모아보세요! 개인 일정을 추가/수정/삭제할수도 있습니다.달력을 직접
대체텍스트 대체텍스트 대체텍스트 대체텍스트 대체텍스트 대체텍스트 대체텍스트 대체텍스트
- 달력을 제로베이스에서부터 생으로 제작했습니다.
- 100% 지분의 순수 제작입니다.
collection 을 이용해 동일한 속성의 데이터들을 반복적으로 비교 연산하는 부분을 줄여줌
const getMonthLengthFn = (year: number, month: number) => {
const comMonth = month;
if (comMonth === 2) {
if (isLeafYear(year)) {
return 29;
} else {
return 28;
}
} else {
if (comMonth < 8) {
if (comMonth % 2 > 0) {
return 31;
} else {
return 30;
}
} else {
if (comMonth % 2 > 0) {
return 30;
} else {
return 31;
}
}
}
};
const isLeafYear = (year: number) => {
const isLeaf: boolean =
(year % 4 === 0 && year % 100 > 0) || (year % 400 === 0 && year % 3200 > 0);
return isLeaf;
};
const getMonthLengthFnImproved = (year: number, month: number) => {
const comMonth = month;
// 2월일 경우 먼저 고려 - 윤년여부
if (comMonth == 2) {
return (year % 4 === 0 && year % 100 > 0) || (year % 400 === 0 && year % 3200 > 0) ? 29 : 28 }
// 나머지 달 (0, 2월은 비워둠)
const mtList = [0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
return mtList[comMonth]
};
https://dillinger.io/ https://shields.io/ 이모지는 : 이미지 정렬은 a태그 align property 사용 license
Shalendar SSAFY #2 IT Portfolio 2.0
Shalendar
$ npm install
$ cd
$ npm start
Please fork this project first and pick one of issues you can handle then shoot us your pull request.