Skip to content

feat(tasks): add all-day date support for tasks#248

Merged
ahmet-cetinkaya merged 4 commits into
mainfrom
feat/all-day-default
Feb 27, 2026
Merged

feat(tasks): add all-day date support for tasks#248
ahmet-cetinkaya merged 4 commits into
mainfrom
feat/all-day-default

Conversation

@ahmet-cetinkaya

@ahmet-cetinkaya ahmet-cetinkaya commented Feb 27, 2026

Copy link
Copy Markdown
Owner

🚀 Motivation and Context

This PR introduces support for all-day dates in tasks. When a user selects a date without specifying a time (e.g., March 12, 2026 at midnight), the system now recognizes this as an all-day event and handles it appropriately - displaying just the date without time, and preserving the semantic meaning during UTC conversions.

⚙️ Implementation Details

  • TaskDateTimeNormalizer utility class: Detects all-day values by checking if the time component is midnight (00:00:00.000), and normalizes dates to UTC while preserving all-day semantics
  • Date validation: Added validation to ensure deadlineDate is not before plannedDate (throws ArgumentError)
  • UI formatting updates: Task cards, date pickers, and dialogs now conditionally format dates based on all-day status (date-only vs date-time display)
  • TaskDateDisplayHelper: Centralized presentation logic for rendering task dates with all-day semantics
  • Updated SaveTaskCommand constructor to use the normalizer

📋 Checklist for Reviewer

  • Tests passed locally.
  • Commit history is clean and descriptive.
  • Documentation updated (if applicable).
  • Code quality standards were met (e.g., linter passed).

🔗 Related

N/A

Introduce TaskDateTimeNormalizer to properly handle date-only (all-day) vs datetime inputs for tasks. The normalizer detects all-day values by checking if the time component is midnight, preserves the semantic meaning during UTC conversion, and validates that deadline date is not before planned date. Updated UI components (task card, date pickers, dialogs) to conditionally format display based on all-day status.

BREAKING CHANGE: SaveTaskCommand now throws ArgumentError when deadlineDate is before plannedDate
@ahmet-cetinkaya ahmet-cetinkaya added the enhancement New feature or request label Feb 27, 2026
@ahmet-cetinkaya ahmet-cetinkaya self-assigned this Feb 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the task management system by adding support for all-day dates. It introduces a TaskDateTimeNormalizer utility to handle date normalization and validation, and updates the UI to format dates accordingly. These changes ensure that date-only values are correctly interpreted and displayed throughout the application, while also preventing invalid date ranges.

Highlights

  • All-Day Date Support: Introduces support for all-day dates in tasks, enhancing the system's ability to recognize and handle date-only entries.
  • TaskDateTimeNormalizer Utility: Implements a utility class to detect all-day values and normalize dates to UTC while preserving all-day semantics.
  • UI Formatting Updates: Updates task cards, date pickers, and dialogs to conditionally format dates based on all-day status, improving UI presentation.
  • Date Validation: Adds validation to ensure deadlineDate is not before plannedDate, preventing potential data inconsistencies.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/lib/core/application/features/tasks/commands/save_task_command.dart
    • The constructor of SaveTaskCommand now uses TaskDateTimeNormalizer to normalize plannedDate and deadlineDate.
    • Added validation to ensure deadlineDate is not before plannedDate.
  • src/lib/core/application/features/tasks/utils/task_date_time_normalizer.dart
    • Introduced TaskDateTimeNormalizer class to normalize and validate task date-time inputs.
    • Implemented isAllDay method to check if a DateTime represents an all-day value.
    • Implemented normalize method to convert date input to UTC while preserving explicit times.
    • Implemented validateDateRange method to ensure the date range is valid when both values are provided.
  • src/lib/presentation/ui/features/tasks/components/quick_add_task_dialog/quick_add_task_dialog.dart
    • Updated _updateDateControllers method to use TaskDateDisplayHelper for formatting dates.
    • Updated date selection logic to use TaskDateDisplayHelper for formatting dates.
  • src/lib/presentation/ui/features/tasks/components/task_card.dart
    • Updated _formatDate method to use TaskDateTimeNormalizer.isAllDay to determine the format type.
  • src/lib/presentation/ui/features/tasks/components/task_date_picker_dialog.dart
    • Added isAllDay property to TaskDatePickerResult class.
    • Updated dialog to pass isAllDay result.
  • src/lib/presentation/ui/features/tasks/components/task_date_picker_field.dart
    • Updated date formatting logic to use TaskDateDisplayHelper when isAllDay is true.
  • src/lib/presentation/ui/features/tasks/components/task_details_content/task_details_content.dart
    • Updated date formatting logic to use TaskDateDisplayHelper.
  • src/lib/presentation/ui/features/tasks/utils/task_date_display_helper.dart
    • Introduced TaskDateDisplayHelper class to centralize presentation logic for rendering task dates with all-day semantics.
    • Implemented formatForInput method to format dates based on all-day status.
  • src/test/core/application/features/tasks/commands/save_task_command_test.dart
    • Added tests for SaveTaskCommand date normalization.
    • Added tests to ensure date-only plannedDate is treated as all-day and normalized to UTC day start.
    • Added tests to ensure explicit plannedDate time is preserved when provided.
    • Added tests to ensure an error is thrown when deadlineDate is before plannedDate.
Activity
  • Introduced support for all-day dates in tasks.
  • Implemented TaskDateTimeNormalizer utility class.
  • Updated UI formatting for task cards, date pickers, and dialogs.
  • Added date validation to prevent deadlineDate before plannedDate.
  • Updated SaveTaskCommand constructor to use the normalizer.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for all-day dates in tasks, enhancing the user experience by displaying dates without time when appropriate and ensuring correct UTC conversions. The changes include a new TaskDateTimeNormalizer class for date normalization and validation, updates to UI formatting, and modifications to the SaveTaskCommand constructor. The code changes look good overall, with attention to detail in handling date formats and time zones. However, there's a potential issue with the isAllDay check in TaskDateTimeNormalizer that could lead to incorrect behavior if the time is not exactly midnight. I've added a review comment to address this.

Comment thread src/lib/core/application/features/tasks/utils/task_date_time_normalizer.dart Outdated
…r proper error handling

- Relocates date range validation from SaveTaskCommand constructor to handler to enable proper BusinessException handling
- Adds validation in TaskRecurrenceService to prevent invalid calculated dates
- Removes validateDateRange from TaskDateTimeNormalizer (no longer needed)
- Adds invalid_date_range translation key across all 21 locales
- Updates tests to expect BusinessException instead of ArgumentError
- Adds error handling with logging in TaskDetailsController
External date sources may include microsecond precision that shouldn't
affect all-day task detection. This change relaxes the date-only check
to only verify hour, minute, and second are zero, ignoring fractional
seconds while preserving the midnight detection behavior.
Update tests to reflect new behavior where fractional seconds are
ignored when detecting all-day events. Dates with milliseconds or
microseconds at midnight (00:00:00.xxx) are now treated as all-day.
@ahmet-cetinkaya ahmet-cetinkaya merged commit 1361171 into main Feb 27, 2026
3 checks passed
@ahmet-cetinkaya ahmet-cetinkaya deleted the feat/all-day-default branch May 22, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant