A10-A16: datetime-local time parsing, step heading, gps_error state, unified leaflet 1.9.4 icons, drop debug log, dashboard error surfacing, isMobile on resize
This commit is contained in:
@@ -41,7 +41,10 @@ const AnalysisResult = () => {
|
||||
|
||||
const getTimeOfDay = (lostTime) => {
|
||||
if (!lostTime) return 'день';
|
||||
const hour = parseInt(lostTime.split(':')[0]);
|
||||
// Значение может прийти как "YYYY-MM-DDTHH:MM" (input type="datetime-local")
|
||||
// или как "HH:MM" — берём часы из обоих форматов.
|
||||
const timePart = lostTime.includes('T') ? lostTime.split('T')[1] : lostTime;
|
||||
const hour = parseInt(timePart.split(':')[0]);
|
||||
if (hour >= 6 && hour < 18) return 'день';
|
||||
if (hour >= 18 && hour < 22) return 'сумерки';
|
||||
return 'ночь';
|
||||
|
||||
Reference in New Issue
Block a user