mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 00:08:18 +00:00
feat(container-returns): show booking ref, company and return time
The returns table renders one list holding both booking-linked and standalone empty returns, but a booking-linked row showed the literal string Associated in place of its reference, and nothing showed the owning company. listEmptyReturns becomes a raw projection joining freight.bookings and freight.companies, so each row carries bookingReference and a companyName that falls back to the booking's company when none was typed on the return itself. Return date was collected as a bare date input, storing every return at 00:00. All three entry points — booking-linked, standalone and the bulk default — now use datetime-local seeded from local time rather than UTC, and the column renders date and time.
This commit is contained in:
@@ -60,3 +60,10 @@ export function formatBytes(bytes: number): string {
|
||||
const value = bytes / Math.pow(1024, i);
|
||||
return `${value.toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
|
||||
}
|
||||
|
||||
/** `YYYY-MM-DDTHH:mm` for now, in local time — what `datetime-local` expects. */
|
||||
export function localNowForInput(): string {
|
||||
const d = new Date();
|
||||
d.setMinutes(d.getMinutes() - d.getTimezoneOffset());
|
||||
return d.toISOString().slice(0, 16);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user