Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨어떤 과제를 수행했나요?✨
2주차 과제인 당근마켓 랜딩 페이지 클론(HTML, CSS 구현), javascript로 달력 만들기 과제를 수행했습니다.
✨어려웠던점, 트러블슈팅✨
🥕 당근마켓 페이지 클론 과제
퍼블리싱 작업을 진행하면서 저에게 익숙하지 않았던 CSS 속성들을 다시금 공부할 수 있어서 좋았습니다.
white-space: nowrap
텍스트가 길어서 부모 요소 안의 가로폭을 넘어가더라도 자동으로 줄바꿈이 일어나게 하고 싶지 않은 부분이 있었는데, 이럴 때는 white-space 속성을 nowrap으로 설정해주면 된다는 것을 찾아 변경했습니다.
justify-content: space-between
당근마켓 랜딩페이지에서는 드래그를 할 시, 홈페이지 성격에 맞춰 background 색상이 변경된다는 것을 알았습니다. 그래서 ::selection을 사용했습니다.
🗓️ 달력 만들기 과제
우선, 날짜를 구하려면 Date 객체를 사용해야 합니다. 과제를 하기 위해 어떻게 하면 오늘 날짜 출력이 가능할까? 부터 접근해보았습니다.
이렇게 코드를 작성하면 해당 달 - 1의 달이 출력되는 것을 확인했습니다. getMonth()메서드는 Zero-base 로 설정되어있기 때문에 +1을 해줘야 정상적인 해당 달이 출력된다는 사실을 알았습니다. 따라서, 해당 달을 구할 때에는
로 작성해주어야 합니다.
🤔 PR Point
🗓️ 달력 만들기 과제
달력 만들기 과제에서 이전, 다음, 현재 달로 이동하는 함수를 이렇게 구현했습니다. 코드를 다시 살펴보니 만약 오늘 날짜가 31일일 경우, nextMonth 함수가 제대로 작동하지 않는 버그가 있습니다. 31일이 없는 달이 있기 때문입니다. 이 부분에 대해서 어떻게 하면 해결할 수 있을지 같이 공부해보고 싶습니다.