Skip to content

npm v1.2.2 배포 #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2023
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ function App() {

## Links

- [Storybook](https://64ae1170f3ddc89ef85a4950-tzfioaatrn.chromatic.com)
- [Storybook](https://64ae1170f3ddc89ef85a4950-ekibdwacuy.chromatic.com)
- [Figma](https://www.figma.com/file/rJUqeL7LUnJjCPQNmQ3BZc/design-system?type=design&node-id=1%3A2854&mode=design&t=nVD5D8xFhO9Dkg6g-1)

## Contributors
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hang-log-design-system",
"version": "1.2.1",
"version": "1.2.2",
"description": "행록 디자인 시스템",
"homepage": "https://github.com/hang-log-design-system/design-system",
"main": "dist/index.js",
14 changes: 8 additions & 6 deletions src/utils/date.ts
Original file line number Diff line number Diff line change
@@ -74,9 +74,9 @@ const isDayOutOfRange = (
dateString: string,
maxDateRange?: number
) => {
if (!dateRange?.start || dateRange?.end || !maxDateRange) return false;
if (!dateRange?.startDate || dateRange?.endDate || !maxDateRange) return false;

const startDate = toDate(dateRange?.start); // Date 타입
const startDate = toDate(dateRange?.startDate); // Date 타입
const currentDate = toDate(dateString); // Date 타입

const diffMilliseconds = currentDate.getTime() - startDate.getTime();
@@ -108,11 +108,13 @@ export const getDayInfo = ({
const isDate = index >= yearMonthData.firstDay && yearMonthData.lastDate >= date;
const isToday = todayDateString === dateString;
const isSelected =
selectedDate === date || dateRange?.start === dateString || dateRange?.end === dateString;
selectedDate === date ||
dateRange?.startDate === dateString ||
dateRange?.endDate === dateString;
const isInRange =
!!dateRange?.start &&
!!dateRange?.end &&
isDayWithinRange?.(dateString, dateRange.start, dateRange.end);
!!dateRange?.startDate &&
!!dateRange?.endDate &&
isDayWithinRange?.(dateString, dateRange.startDate, dateRange.endDate);
const isRestricted =
(isFutureDaysRestricted && isDayInFuture(dateString, todayDateString)) ||
(hasRangeRestriction && isDayOutOfRange(dateRange, dateString, maxDateRange));