Bugfix: Fix correct deadline/start date validation in job creation form#2314
Open
CelineLahnor wants to merge 10 commits intomainfrom
Open
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Complexity | 1 medium |
🟢 Metrics 33 complexity
Metric Results Complexity 33
TIP This summary will be updated as you push new changes. Give us feedback
…start-date-is-earlier-than-application-deadline
There was a problem hiding this comment.
Pull request overview
This PR fixes invalid date combinations in the professor job creation form by ensuring the position start date cannot be earlier than the application deadline, and by improving the datepicker UX to guide correct selection.
Changes:
- Add a shared form-group validator to enforce
startDate >= applicationDeadline. - Derive datepicker min/max bounds from the opposite selected date and visually highlight the reference date with a tooltip.
- Extract shared local date parsing logic and expand Vitest coverage for the new behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/webapp/app/job/job-creation-form/job-creation-form.component.ts | Adds date-order validation, computed min/max bounds for date pickers, and blocks autosave when date order is invalid. |
| src/main/webapp/app/job/job-creation-form/job-creation-form.component.html | Wires new min/max bounds and highlighted reference date tooltips into both date pickers. |
| src/main/webapp/app/shared/validators/date-order-validator.ts | Introduces a reusable cross-field validator for ISO local date strings. |
| src/main/webapp/app/shared/util/date-time.util.ts | Adds parseLocalDateString for timezone-safe parsing of YYYY-MM-DD into local-midnight Date. |
| src/main/webapp/app/shared/components/atoms/datepicker/datepicker.component.ts | Uses shared local date parsing and adds highlighted-day detection. |
| src/main/webapp/app/shared/components/atoms/datepicker/datepicker.component.html | Moves styling to Tailwind and renders the highlighted reference day with a tooltip. |
| src/main/webapp/app/shared/components/atoms/datepicker/datepicker.component.scss | Removes SCSS styling now replaced by Tailwind selectors. |
| src/main/webapp/i18n/en/job.json | Updates placeholder text and adds labels for highlighted reference dates. |
| src/main/webapp/i18n/de/job.json | Updates placeholder text and adds labels for highlighted reference dates. |
| src/test/webapp/app/job/job-creation-form/job-creation-form.component.spec.ts | Adds tests for date-order validity and derived datepicker bounds. |
| src/test/webapp/app/shared/components/atoms/datepicker/datepicker.component.spec.ts | Adds a test for highlighted reference date detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…start-date-is-earlier-than-application-deadline
…is-earlier-than-application-deadline' of https://github.com/ls1intum/tum-apply into bugfix/1487-prevent-invalid-job-dates-where-start-date-is-earlier-than-application-deadline
…start-date-is-earlier-than-application-deadline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
General
Client
Motivation and Context
Closes #1487
Description
This PR prevents invalid date combinations in the professor job creation form by enforcing that the start date must be the same day as or later than the application deadline.
Changes
Steps for Testing
Review Progress
Code Review
Manual Tests
Screenshots
Bildschirmaufnahme.2026-04-18.um.15.32.32.mov
I also updated the job creation form so the start date picker appears on the left and the application deadline picker on the right, matching the intended UI order.

Test Coverage
Client
Last updated: 2026-04-19 15:30:23 UTC