Completed discovery page

This commit is contained in:
Aleksi Lassila
2023-07-31 00:09:07 +03:00
parent 77153a96c5
commit 8e60c8fad2
37 changed files with 876 additions and 325 deletions

View File

@@ -79,3 +79,16 @@ export function log(arg: any) {
console.log('LOGGER', arg);
return arg;
}
export function formatDateToYearMonthDay(date: Date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
export function capitalize(str: string) {
const strings = str.split(' ');
return strings.map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(' ');
}