fix short date formatting

This commit is contained in:
mbecker20
2024-04-09 23:56:47 -07:00
parent 29edd6b9b5
commit fb72bbf81e
+5 -4
View File
@@ -1,9 +1,10 @@
import { Types } from "@monitor/client";
export const fmt_date = (d: Date) => {
return `${d.getDate()}/${
d.getMonth() + 1
} @ ${d.getHours()}:${d.getMinutes()}`;
const minutes = d.getMinutes();
return `${d.getDate()}/${d.getMonth() + 1} @ ${d.getHours()}:${
minutes > 9 ? minutes : "0" + minutes
}`;
};
export const fmt_date_with_minutes = (d: Date) => {
@@ -37,4 +38,4 @@ export function snake_case_to_upper_space_case(snake: string) {
.split("_")
.map((item) => item[0].toUpperCase() + item.slice(1))
.join(" ");
}
}