feat: normalizar la hora de finalización de citas que cruzan la medianoche y ajustar la lógica de ordenamiento en CalendarRowView
This commit is contained in:
@@ -12,6 +12,7 @@ export interface CalendarRowViewProps {
|
||||
|
||||
type CalendarRowViewData = {
|
||||
name: string;
|
||||
startTime: number;
|
||||
events: TXCalendarEvent[];
|
||||
};
|
||||
|
||||
@@ -167,11 +168,13 @@ export default function CalendarRowView(props: CalendarRowViewProps) {
|
||||
} else {
|
||||
auxData.push({
|
||||
name: time,
|
||||
startTime: item.startTime,
|
||||
events: [item],
|
||||
});
|
||||
}
|
||||
}
|
||||
setData(auxData.sort((a, b) => a.name.localeCompare(b.name)));
|
||||
// Sort by numeric hour, never by the formatted label: as strings "11:00 PM" < "5:00 PM".
|
||||
setData(auxData.sort((a, b) => a.startTime - b.startTime));
|
||||
}, [daySchedules]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user