Skip to content

Commit

Permalink
fix : 시간대 기준 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yel-m committed May 25, 2024
1 parent 32ba027 commit 63f8e30
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@

@AllArgsConstructor
public enum TimePeriod {
DAWN("새벽"),
MORNING("아침"),
AFTERNOON("점심"),
AFTERNOON(""),
EVENING("저녁"),
NIGHT("밤");

private final String viewName;

public static TimePeriod of(int hour) {
if (hour >= 6 && hour < 12) {
if (hour >= 0 && hour < 5) {
return DAWN;
} else if (hour >= 5 && hour < 9) {
return MORNING;
} else if (hour >= 12 && hour < 18) {
} else if (hour >= 9 && hour < 17) {
return AFTERNOON;
} else if (hour >= 18 && hour < 24) {
} else if (hour >= 17 && hour < 21) {
return EVENING;
} else {
return NIGHT;
Expand Down

0 comments on commit 63f8e30

Please sign in to comment.