Compare commits

..

22 Commits

Author SHA1 Message Date
3a81b65a06 fix(deps): update nextjs monorepo to v16
Some checks failed
Check / Lint and Check (push) Failing after 16s
Check / Lint and Check (pull_request) Failing after 17s
2025-11-01 08:00:51 +00:00
a00599ef22 fix(deps): update dependency lucide-react to ^0.552.0
All checks were successful
Check / Lint and Check (push) Successful in 27s
2025-11-01 07:19:40 +00:00
34cb1fd4aa chore(deps): update actions/setup-node action to v6 (#15)
All checks were successful
Check / Lint and Check (push) Successful in 26s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-node](https://github.com/actions/setup-node) | action | major | `v5` -> `v6` |

---

### Release Notes

<details>
<summary>actions/setup-node (actions/setup-node)</summary>

### [`v6`](https://github.com/actions/setup-node/compare/v5...v6)

[Compare Source](https://github.com/actions/setup-node/compare/v5...v6)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMjIuMyIsInVwZGF0ZWRJblZlciI6IjQxLjEyMi4zIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: #15
Co-authored-by: Renovate Bot <renovatebot@schulze.network>
Co-committed-by: Renovate Bot <renovatebot@schulze.network>
2025-11-01 08:14:00 +01:00
589d3b870e chore(deps): update dependency node to v24
All checks were successful
Check / Lint and Check (pull_request) Successful in 28s
Check / Lint and Check (push) Successful in 25s
2025-11-01 07:52:28 +01:00
fe5c9d4dae chore(deps): update pnpm to v10.20.0
All checks were successful
Check / Lint and Check (push) Successful in 39s
2025-11-01 05:00:41 +00:00
324f7d4061 chore(deps): update dependency turbo to v2.6.0
All checks were successful
Check / Lint and Check (push) Successful in 29s
2025-11-01 04:00:52 +00:00
778d65a357 chore(deps): update dependency react-hook-form to v7.66.0
All checks were successful
Check / Lint and Check (push) Successful in 30s
2025-11-01 03:00:50 +00:00
1fdec62dbd chore(deps): update dependency eslint to v9.39.0
All checks were successful
Check / Lint and Check (push) Successful in 27s
2025-11-01 02:01:00 +00:00
4b02928b8f chore(deps): update dependency cssnano to v7.1.2
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-11-01 01:00:53 +00:00
a3bd460c0c chore(deps): update dependency @types/node to v22.18.13
All checks were successful
Check / Lint and Check (push) Successful in 31s
2025-11-01 00:00:43 +00:00
4b93109582 add block duration and test
All checks were successful
Check / Lint and Check (push) Successful in 33s
2025-10-27 12:53:56 +01:00
dba0d58477 fix(deps): update dependency lucide-react to ^0.548.0
All checks were successful
Check / Lint and Check (push) Successful in 33s
2025-10-25 03:00:52 +00:00
3a5d65fc5c chore(deps): update pnpm to v10.19.0
All checks were successful
Check / Lint and Check (push) Successful in 37s
2025-10-25 02:00:44 +00:00
eeed7ba07f chore(deps): update tailwindcss monorepo to v4.1.16
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-10-25 01:00:53 +00:00
efa4907b49 chore(deps): update dependency @types/node to v22.18.12
All checks were successful
Check / Lint and Check (push) Successful in 45s
2025-10-25 00:00:45 +00:00
c53b6d18e5 Added 2025 dates
All checks were successful
Check / Lint and Check (push) Successful in 1m9s
2025-10-24 18:58:41 +02:00
110d7f25c9 fix(deps): update dependency lucide-react to ^0.546.0
All checks were successful
Check / Lint and Check (push) Successful in 30s
2025-10-18 05:00:47 +00:00
6d6c7e9775 chore(deps): update dependency eslint to v9.38.0
All checks were successful
Check / Lint and Check (push) Successful in 34s
2025-10-18 04:00:47 +00:00
aca89c0cab chore(deps): update pnpm to v10.18.3
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-10-18 03:00:55 +00:00
49665c375f chore(deps): update nextjs monorepo to v15.5.6
All checks were successful
Check / Lint and Check (push) Successful in 27s
2025-10-18 02:00:56 +00:00
9bbd282380 chore(deps): update dependency @types/react-dom to v19.2.2
All checks were successful
Check / Lint and Check (push) Successful in 32s
2025-10-18 01:00:52 +00:00
97be9dcacb chore(deps): update dependency @types/node to v22.18.11
All checks were successful
Check / Lint and Check (push) Successful in 37s
2025-10-18 00:00:39 +00:00
6 changed files with 857 additions and 593 deletions

View File

@@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22
node-version: 24
cache: "pnpm"
- name: Install dependencies

View File

@@ -1,7 +1,8 @@
{
"eventDates": ["2025-09-05", "1999-01-01"],
"eventDates": ["2025-09-05", "2025-10-25", "2025-12-06", "1999-01-01"],
"cutoffTime": "23:00",
"blockDurationHours": 6,
"message": "Sign-ups are closed for today's event. Please come back tomorrow.",
"internalComment": "Add event dates in YYYY-MM-DD format. Signups will be disabled after 11pm (23:00) on these dates by default."
"internalComment": "Add event dates in YYYY-MM-DD format. Signups will be disabled after cutoffTime (23:00) for blockDurationHours (6 hours)."
}

View File

@@ -0,0 +1,40 @@
import { isSignupBlocked } from "./signup-time-check";
// Test helper to check different scenarios
function testScenario(description: string, date: Date, expected: boolean) {
const result = isSignupBlocked(date);
const status = result.blocked === expected ? "✅ PASS" : "❌ FAIL";
console.log(`${status} ${description}`);
console.log(` Expected blocked: ${expected}, Got: ${result.blocked}`);
if (result.message) {
console.log(` Message: ${result.message}`);
}
console.log();
}
// Run tests
console.log("Testing signup blocking logic...\n");
// October 25, 2025 at 22:00 (before cutoff)
testScenario("Oct 25 at 22:00 - Before cutoff", new Date("2025-10-25T22:00:00"), false);
// October 25, 2025 at 23:00 (exactly at cutoff)
testScenario("Oct 25 at 23:00 - At cutoff time", new Date("2025-10-25T23:00:00"), true);
// October 25, 2025 at 23:30 (during block period)
testScenario("Oct 25 at 23:30 - During block period", new Date("2025-10-25T23:30:00"), true);
// October 26, 2025 at 02:00 (3 hours into block)
testScenario("Oct 26 at 02:00 - 3 hours into block", new Date("2025-10-26T02:00:00"), true);
// October 26, 2025 at 04:59 (just before block ends)
testScenario("Oct 26 at 04:59:59 - Just before block ends", new Date("2025-10-26T04:59:59"), true);
// October 26, 2025 at 05:00 (block period over)
testScenario("Oct 26 at 05:00 - Block period ended", new Date("2025-10-26T05:00:00"), false);
// October 26, 2025 at 12:00 (well after block)
testScenario("Oct 26 at 12:00 - Well after block", new Date("2025-10-26T12:00:00"), false);
// Random non-event date
testScenario("Oct 20 at 23:00 - Non-event date", new Date("2025-10-20T23:00:00"), false);

View File

@@ -1,17 +1,23 @@
import eventConfig from "@/event-dates.json";
export function isSignupBlocked(): { blocked: boolean; message?: string } {
const now = new Date();
const currentDate = now.toISOString().split("T")[0]; // YYYY-MM-DD format
const currentTime = now.toTimeString().slice(0, 5); // HH:MM format
export function isSignupBlocked(currentTime?: Date): { blocked: boolean; message?: string } {
const now = currentTime || new Date();
const cutoffTime = eventConfig.cutoffTime || "15:00";
const blockDurationHours = eventConfig.blockDurationHours || 6;
// Check if today is an event date
const isEventDay = eventConfig.eventDates.includes(currentDate);
// Check each event date to see if we're in a block period
for (const eventDate of eventConfig.eventDates) {
// Parse the event date and cutoff time in local timezone
const [year, month, day] = eventDate.split("-").map(Number);
const [hours, minutes] = cutoffTime.split(":").map(Number);
const blockStart = new Date(year, month - 1, day, hours, minutes, 0, 0);
if (isEventDay) {
// Check if current time is after the cutoff time (default 15:00 / 3pm)
const cutoffTime = eventConfig.cutoffTime || "15:00";
if (currentTime >= cutoffTime) {
// Calculate when the block period ends (using wall-clock hours to handle DST correctly)
const blockEnd = new Date(blockStart);
blockEnd.setHours(blockStart.getHours() + blockDurationHours);
// Check if current time is within the block period
if (now >= blockStart && now < blockEnd) {
return {
blocked: true,
message: eventConfig.message,

View File

@@ -18,8 +18,8 @@
"clsx": "^2.1.1",
"cssnano": "^7.1.0",
"date-fns": "^4.1.0",
"lucide-react": "^0.545.0",
"next": "^15.4.1",
"lucide-react": "^0.552.0",
"next": "^16.0.0",
"next-plausible": "^3.12.4",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^10.2.4",
@@ -32,17 +32,17 @@
"zod": "^4.0.5"
},
"devDependencies": {
"@tailwindcss/postcss": "4.1.14",
"@types/node": "22.18.10",
"@tailwindcss/postcss": "4.1.16",
"@types/node": "24.9.2",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.1",
"eslint": "9.37.0",
"eslint-config-next": "15.5.4",
"@types/react-dom": "19.2.2",
"eslint": "9.39.0",
"eslint-config-next": "16.0.1",
"eslint-config-prettier": "10.1.8",
"postcss": "8.5.6",
"tailwindcss": "4.1.14",
"turbo": "2.5.8",
"tailwindcss": "4.1.16",
"turbo": "2.6.0",
"typescript": "5.9.3"
},
"packageManager": "pnpm@10.18.2"
"packageManager": "pnpm@10.20.0"
}

1357
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff