1. Session end time saving. 2. Plan Id to the saved session. 3. History page redesigned (attributes moved, sets list hidden. 4. Session duration added. 5. Session start and end time logging fixed.
This commit is contained in:
@@ -92,6 +92,7 @@ const translations = {
|
||||
end_time: 'End',
|
||||
max: 'Max',
|
||||
upto: 'Up to',
|
||||
no_plan: 'No plan',
|
||||
|
||||
// Plans
|
||||
plans_empty: 'No plans created',
|
||||
@@ -232,6 +233,7 @@ const translations = {
|
||||
end_time: 'Конец',
|
||||
max: 'Макс',
|
||||
upto: 'До',
|
||||
no_plan: 'Без плана',
|
||||
|
||||
// Plans
|
||||
plans_empty: 'Нет созданных планов',
|
||||
|
||||
@@ -3,7 +3,13 @@ import { api } from './api';
|
||||
|
||||
export const getSessions = async (userId: string): Promise<WorkoutSession[]> => {
|
||||
try {
|
||||
return await api.get('/sessions');
|
||||
const sessions = await api.get('/sessions');
|
||||
// Convert ISO date strings to timestamps
|
||||
return sessions.map((session: any) => ({
|
||||
...session,
|
||||
startTime: new Date(session.startTime).getTime(),
|
||||
endTime: session.endTime ? new Date(session.endTime).getTime() : undefined
|
||||
}));
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user