feat: Added current opening times to each study space on the main page. In the expanded card, you can view the opening times for the full week. Improved ui
Co-Authored-By: Tadios Temesgen <tt2022@ic.ac.uk>
This commit is contained in:
@@ -8,7 +8,6 @@ export type Enum<T extends keyof Database["public"]["Enums"]> = Database["public
|
||||
export const availableStudySpaceTags = [
|
||||
"Crowded",
|
||||
"Group study",
|
||||
"24/7",
|
||||
"Food allowed",
|
||||
"No food allowed",
|
||||
"Well lit",
|
||||
@@ -43,3 +42,20 @@ export async function gmapsLoader() {
|
||||
libraries: ["places"]
|
||||
});
|
||||
}
|
||||
|
||||
export function formatTime(time: string) {
|
||||
const [h, m] = time.split(":").map(Number);
|
||||
const date = new Date();
|
||||
date.setHours(h, m);
|
||||
return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
||||
}
|
||||
|
||||
export const daysOfWeek = [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user