♻️ Switch to app router (#922)

This commit is contained in:
Luke Vella 2023-11-06 09:15:49 +00:00 committed by GitHub
parent 41f85279bb
commit 95feb9f01a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
181 changed files with 2507 additions and 2494 deletions

View file

@ -0,0 +1,4 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
...require("@rallly/eslint-config")(__dirname),
};

View file

@ -15,7 +15,6 @@
"@trpc/server": "^10.13.0",
"iron-session": "^6.3.1",
"spacetime": "^7.4.7",
"stripe": "^13.2.0",
"timezone-soft": "^1.4.1"
"stripe": "^13.2.0"
}
}

View file

@ -178,7 +178,10 @@ export const polls = router({
if (input.optionsToAdd && input.optionsToAdd.length > 0) {
await prisma.option.createMany({
data: input.optionsToAdd.map((optionValue) => {
const [start, end] = optionValue.split("/");
const [start, end] = z
.tuple([z.string(), z.string()])
.parse(optionValue.split("/"));
if (end) {
return {
start: new Date(`${start}Z`),

View file

@ -1,6 +1,5 @@
{
"extends": "@rallly/tsconfig/react-library.json",
"include": ["**/*.ts", "**/*.tsx", "iron-session.d.t.s"],
"extends": "@rallly/tsconfig/react.json",
"include": ["**/*.ts", "**/*.tsx", "**/*.js"],
"exclude": ["node_modules"]
}

View file

@ -10,8 +10,11 @@ dayjs.extend(timezone);
export const getTimeZoneAbbreviation = (date: Date, timeZone: string) => {
const timeZoneDisplayFormat = soft(timeZone)[0];
const spaceTimeDate = spacetime(date, timeZone);
const standardAbbrev = timeZoneDisplayFormat.standard.abbr;
const dstAbbrev = timeZoneDisplayFormat.daylight?.abbr;
if (!timeZoneDisplayFormat) {
console.error(`No timezone display format for ${timeZone}`);
}
const standardAbbrev = timeZoneDisplayFormat?.standard.abbr ?? timeZone;
const dstAbbrev = timeZoneDisplayFormat?.daylight?.abbr ?? timeZone;
const abbrev = spaceTimeDate.isDST() ? dstAbbrev : standardAbbrev;
return abbrev;
};