Skip to content

feat: date pick question#796

Merged
johannesvedder merged 24 commits into
devfrom
feat/date-question
Jun 25, 2026
Merged

feat: date pick question#796
johannesvedder merged 24 commits into
devfrom
feat/date-question

Conversation

@ibrahimozkn

Copy link
Copy Markdown
Contributor

This pull request introduces support for a new DateQuestion type in the questionnaire system, including backend model, serialization, designer form controls, and frontend UI integration. The changes enable date and date-time questions with validation, customizable formats, and localization. The most important changes are grouped below:

Backend Model & Serialization:

  • Added the new DateQuestion model with fields for minimum/maximum date, format presets, and initial value, including JSON serialization and deserialization (date_question.dart, date_question.g.dart, date_format_preset.dart). [1] [2] [3]
  • Registered DateQuestion in the questionnaire question factory and exported it in the questions module (question.dart, questions.dart). [1] [2]

Designer Form Integration:

  • Added form controls and validation helpers for date questions in the designer, including controls for min/max/initial date and format preset, and auto-correction logic for initial value outside range (question_form_controller.dart). [1] [2] [3] [4]

Frontend UI Integration:

  • Implemented the DateQuestionWidget for the app, supporting date and time picking, validation, formatting, clearing, and submission, with localization support (date_question_widget.dart, question_container.dart). [1] [2] [3]

Localization:

  • Added new localization keys and translations for date picker UI and validation messages in English and German, and updated the localization interface (app_en.arb, app_localizations.dart, app_localizations_en.dart, app_localizations_de.dart). [1] [2] [3] [4]

Miscellaneous:

  • Minor import and type registration updates to support the new question type and designer integration (question_form_controller.dart).

These changes collectively enable robust date and date-time questions in both the study designer and participant app, with full localization and validation support.

…uestionnaires

- Introduced DateQuestion model with minDate, maxDate, dateFormatPreset, and initialDate properties.
- Created DateFormatPreset enum for various date formats.
- Implemented DateQuestionWidget to handle date selection with optional time.
- Added localization support for date-related strings in English and German.
- Updated questionnaire form to include date question handling and validation.
- Enhanced UI with date picker and time picker functionalities.
@github-actions

github-actions Bot commented Feb 12, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 911ce56):

(expires Tue, 23 Jun 2026 13:31:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b

Comment thread app/lib/l10n/app_localizations_de.dart
Comment thread core/lib/src/models/questionnaire/questions/date_question.dart Outdated
Comment thread designer_v2/lib/localization/app_en.arb Outdated
Comment thread designer_v2/lib/features/study/study_test_frame_controllers.dart Outdated
@gitguardian

gitguardian Bot commented Mar 1, 2026

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

…ation

- Updated DateQuestionFormData to include input type, min/max time, and default options for date/time.
- Modified DateQuestionFormView to dynamically display input fields based on selected input type (date, time, datetime).
- Added new localization strings for time input, date input types, and validation messages in both English and German.
- Improved UI to handle specific default date/time selections and constraints for min/max dates and times.
@johannesvedder

Copy link
Copy Markdown
Contributor
image "Invalid" question does not get saved on the server.

@johannesvedder

Copy link
Copy Markdown
Contributor
image

The validation message is directly printed when the question is shown. I don't think we need it or only show it for invalid entries?

@johannesvedder

Copy link
Copy Markdown
Contributor
image

Bug 2 from above is still happening

@johannesvedder

Copy link
Copy Markdown
Contributor
image

@johannesvedder

Copy link
Copy Markdown
Contributor

And what effect does the submit button has? Do you need to press it or is it unnecessary cause the state seems to update itself for first entry and later entry even if the button is not pressed, so I think it can be deleted?
image

@johannesvedder johannesvedder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

@johannesvedder johannesvedder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following bug is still present:

  • You should not be able to submit a questionnaire if not all time/date fields have been filled out
Image

@johannesvedder

Copy link
Copy Markdown
Contributor

Failing E2E test also needs to be fixed

@johannesvedder

Copy link
Copy Markdown
Contributor

I will wait with this until #844 is merged

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 10, 2026
@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label Jun 10, 2026
@johannesvedder johannesvedder merged commit 524a582 into dev Jun 25, 2026
11 checks passed
@johannesvedder johannesvedder deleted the feat/date-question branch June 25, 2026 11:06
@johannesvedder johannesvedder mentioned this pull request Jun 29, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants