mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-12 15:41:53 +02:00
♻️ Switch to app router (#922)
This commit is contained in:
parent
41f85279bb
commit
95feb9f01a
181 changed files with 2507 additions and 2494 deletions
4
packages/backend/.eslintrc.js
Normal file
4
packages/backend/.eslintrc.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
/** @type {import("eslint").Linter.Config} */
|
||||
module.exports = {
|
||||
...require("@rallly/eslint-config")(__dirname),
|
||||
};
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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`),
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue