1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 export const formatDate = (isoDate: string) => {
6 const date = new Date(isoDate);
7 return date.toLocaleString();
10 export const formatFileSize = (size?: number) => {
11 if (typeof size === "number") {
12 for (const { base, unit } of fileSizes) {
14 return `${(size / base).toFixed()} ${unit}`;