refactor: centralize compact date formatting
This commit is contained in:
@@ -11,6 +11,7 @@ from datetime import datetime, time as dt_time, timedelta
|
||||
from threading import Lock
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from backend.bootstrap.config import display_compact_date as _display_date
|
||||
from backend.data.numbers import finite_number as _number
|
||||
from backend.features.sentiment.engine import apply_sentiment_to_dashboard
|
||||
|
||||
@@ -2007,10 +2008,6 @@ def _display_time(value: Any) -> str:
|
||||
return f"{raw[:2]}:{raw[2:4]}:{raw[4:6]}"
|
||||
|
||||
|
||||
def _display_date(value: str) -> str:
|
||||
return f"{value[:4]}-{value[4:6]}-{value[6:8]}" if len(value) == 8 else value
|
||||
|
||||
|
||||
def _realtime_market_status(current_time: dt_time) -> str:
|
||||
if current_time < dt_time(9, 25):
|
||||
return "pre_open"
|
||||
|
||||
Reference in New Issue
Block a user