fix: 저녁 시작을 17시보다 이르지 않게 — 겨울에 오후 3시가 저녁이던 것
This commit is contained in:
1 parent
639ca83553
commit
96e40d00c8
7 files changed
+53
-20
No files matched your search
@@ -2,7 +2,7 @@ from dataclasses import dataclass
|
||||
from types import SimpleNamespace
|
||||
from typing import Literal, Optional
|
||||
|
||||
from services.calc.day_slot import NIGHT_END_HOUR, SLOTS
|
||||
from services.calc.day_slot import EVENING_EARLIEST_HOUR, NIGHT_END_HOUR, SLOTS
|
||||
|
||||
Rain = Literal["dry", "wet"]
|
||||
Air = Literal["good", "normal"]
|
||||
@@ -59,11 +59,12 @@ _TEMP_MIN, _TEMP_MAX = -20, 40
|
||||
|
||||
def _slot_of_hour(h: int) -> str:
|
||||
h %= 24
|
||||
evening_from = max(_SUNSET_HOUR - 2, EVENING_EARLIEST_HOUR)
|
||||
if NIGHT_END_HOUR <= h < 11:
|
||||
return "morning"
|
||||
if 11 <= h < _SUNSET_HOUR - 2:
|
||||
if 11 <= h < evening_from:
|
||||
return "day"
|
||||
if _SUNSET_HOUR - 2 <= h < _SUNSET_HOUR + 1:
|
||||
if evening_from <= h < _SUNSET_HOUR + 1:
|
||||
return "evening"
|
||||
return "night"
|
||||
|
||||
|
||||
Reference in new issue
Block a user