🚸 ♻️ Refactor store and improve UX
- Move view related functions out of the store - Restructure the store.js file - Improve error handling of `/check` - Show red loading spinner if data fetch failed - Prefetch current, next and previous day instead of only current - Refactor some other frontend file
This commit is contained in:
@ -33,3 +33,11 @@ export function getDateSkippingWeekend(date, onlyNext) {
|
||||
);
|
||||
return date;
|
||||
}
|
||||
|
||||
export function getNextAndPrevDay(date) {
|
||||
return [
|
||||
new Date(date.getTime()),
|
||||
getDateSkippingWeekend(new Date(date.getTime() + 86400000)),
|
||||
getDateSkippingWeekend(new Date(date.getTime() - 86400000)),
|
||||
].map((e) => e.getTime());
|
||||
}
|
||||
|
Reference in New Issue
Block a user