mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Update generate-packages-index.ts
This commit is contained in:
parent
3bf4e37b22
commit
e270bb7071
@ -101,6 +101,14 @@ function humanFileSize(bytes: number, si = false, dp = 1) {
|
||||
return bytes.toFixed(dp) + ' ' + units[u];
|
||||
}
|
||||
|
||||
const dateTimeOptions = {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "numeric",
|
||||
};
|
||||
|
||||
function indexLayout(prefix: string, files: _Object[], dirs: string[]): string {
|
||||
const rows: [link: string, name: string, size?: number, date?: Date][] = [];
|
||||
|
||||
@ -138,13 +146,7 @@ function indexLayout(prefix: string, files: _Object[], dirs: string[]): string {
|
||||
${rows.map(([link, name, size, date]) => `<tr>
|
||||
<td class="link"><a href="${link}">${name}</a></td>
|
||||
<td class="size">${size ? humanFileSize(size) : "-"}</td>
|
||||
<td class="date">${date?.toLocaleString("en-GB", {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "numeric",
|
||||
}) ?? "-"}</td>
|
||||
<td class="date">${date?.toLocaleString("en-GB", dateTimeOptions) ?? "-"}</td>
|
||||
</tr>`).join("")}
|
||||
</tbody>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user