Skip to content
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

[feat] 메뉴 상세정보에서 현재 날짜가 가장 먼저 표시되도록 수정 #233

Merged
merged 7 commits into from
Sep 21, 2022

Conversation

i-colours-u
Copy link
Member

@i-colours-u i-colours-u commented Aug 29, 2022

🔥 Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용
기존에는 무조건 월요일부터 영업시간이 표기가 되었다면,
현재 요일에 맞춰서, 표기되도록 수정
(ex 화요일인 경우, 화요일이 먼저 표시되도록)

  • Swift의 기본 Date의 weekday 값을 활용했는데,
    여기서는 일요일이 1, 월요일이 2 화요일이 3.. 이렇게 표시되는 반면,

저희 서버에서 주는 정보는
월요일이 0, 화요일이 1... 이런 순으로 진행되어서
따로 계산하는 식을 추가하였습니다.

📸 스크린샷

IMG_6586

IMG_6787

@i-colours-u i-colours-u added the Add Feat 이외의 부수적인 코드 추가, 라이브러리 추가, 새로운 View 생성 label Aug 29, 2022
@i-colours-u i-colours-u self-assigned this Aug 29, 2022
Copy link
Member

@L-j-h-c L-j-h-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 👼

Comment on lines +146 to +148
if isOpenned &&
currentDay >= 0 &&
!expandableData.labelText[currentDay].isEmpty {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5;

어웈... 그러면 지금 날짜순 정렬은 적용되어 있지 않은 상태이죠?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

날짜순 정렬이라는게 무슨 의미인가요?!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

월화수목금토 -> 수목금토일월화 이런식으로 변경되는 건데, 혹시 적용되어 있는건가욤?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

월화수목금토 -> 수목금토일월화 로 변경되는거였나요?
저는
카카오맵이나 네이버지도에서 쓰는 방식처럼

(펼치기 전에는) 오늘 날짜에 해당하는 요일의 시간 1개만 표기하고,
(펼치면) 전체 날짜를 표기하는 식으로 처리했었는데,

이렇게 하는게 아니였나요..?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

두개다 해야하는 것 같습니다 ㅜㅜㅜㅜ 펼치기 전에는 해당 요일의 시간 + 펼친 후에는 해당 요일부터 순서대로 근데 혹시 모르니 한번 더 질문해보겠습니다

Comment on lines +10 to +25
extension Date {
// Swift 상에서는 일 -> 1, 월 -> 2로 표기되지만,
// 현재 서버에서는 월 -> 0, 화 -> 1로 표기되고 있어서 변환하는 계산식을 추가하였습니다.
func dayNumberOfWeek() -> Int {
if let day = Calendar.current.dateComponents([.weekday], from: self).weekday {
switch(day) {
case 1 : return 6
case 2 : return 0
case 3...7 : return day - 2
default : return -1
}
} else {
return -1
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5;

👍 👍

@i-colours-u
Copy link
Member Author

펼쳤을 때, 해당 요일에 해당하는 경우
NSMutableAttributedString 활용해서 볼드처리 해두었습니다~!
d792fa5 @L-j-h-c 확인만 해주세요~!

@L-j-h-c
Copy link
Member

L-j-h-c commented Sep 12, 2022

@i-colours-u
확인했습니다 감사합니다!

@i-colours-u i-colours-u merged commit 8381896 into Health-Food-Me:develop Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add Feat 이외의 부수적인 코드 추가, 라이브러리 추가, 새로운 View 생성
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants