mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-28 14:20:46 -05:00
db.calendar -> db.calendarEvents
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -23,5 +23,5 @@ Calendar
|
||||
- [x] Maybe classNames that do nothing on calendar event page?
|
||||
- [ ] refactor global.css/common.css -> variables.css / utils.css / common.css
|
||||
- [ ] addTagArray get tags type from constant
|
||||
- [ ] Rename model events -> calendarEvents
|
||||
- [x] Rename model events -> calendarEvents
|
||||
- [x] On the event page should not say Day 1 if only one day
|
||||
|
||||
@@ -2,12 +2,12 @@ import * as users from "./models/users.server";
|
||||
import * as plusSuggestions from "./models/plusSuggestions.server";
|
||||
import * as plusVotes from "./models/plusVotes.server";
|
||||
import * as badges from "./models/badges.server";
|
||||
import * as calendar from "./models/calendar.server";
|
||||
import * as calendarEvents from "./models/calendar.server";
|
||||
|
||||
export const db = {
|
||||
users,
|
||||
plusSuggestions,
|
||||
plusVotes,
|
||||
badges,
|
||||
calendar,
|
||||
calendarEvents,
|
||||
};
|
||||
|
||||
@@ -31,11 +31,11 @@ export const loader = ({ params }: LoaderArgs) => {
|
||||
const parsedParams = z
|
||||
.object({ id: z.preprocess(actualNumber, id) })
|
||||
.parse(params);
|
||||
const event = notFoundIfFalsy(db.calendar.findById(parsedParams.id));
|
||||
const event = notFoundIfFalsy(db.calendarEvents.findById(parsedParams.id));
|
||||
|
||||
return json({
|
||||
event,
|
||||
badgePrizes: db.calendar.findBadgesById(parsedParams.id),
|
||||
badgePrizes: db.calendarEvents.findBadgesById(parsedParams.id),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export const loader = async ({ request }: LoaderArgs) => {
|
||||
return json({
|
||||
currentWeek,
|
||||
displayedWeek,
|
||||
nearbyStartTimes: db.calendar.startTimesOfRange({
|
||||
nearbyStartTimes: db.calendarEvents.startTimesOfRange({
|
||||
startTime: subMonths(
|
||||
weekNumberToDate({ week: displayedWeek, year: displayedYear }),
|
||||
1
|
||||
@@ -114,7 +114,7 @@ function fetchEventsOfWeek(args: { week: number; year: number }) {
|
||||
// so we get all events of sunday even from US west coast perspective
|
||||
endTime.setHours(endTime.getHours() + 12);
|
||||
|
||||
return db.calendar.findAllBetweenTwoTimestamps({ startTime, endTime });
|
||||
return db.calendarEvents.findAllBetweenTwoTimestamps({ startTime, endTime });
|
||||
}
|
||||
|
||||
export default function CalendarPage() {
|
||||
|
||||
Reference in New Issue
Block a user