-
Notifications
You must be signed in to change notification settings - Fork 6
fix(windows,linux): convert AM/PM pattern from 'tt' to 'a' #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes AM/PM pattern representation across Windows and Linux implementations to use the standard 'a' pattern instead of 'tt', ensuring compatibility with Flutter/Dart date/time formatting conventions. The changes also include performance improvements and enhanced memory safety in the Linux implementation.
- Converts AM/PM patterns from 'tt' to 'a' for Flutter/Dart compatibility
- Replaces fixed-size buffer with dynamic allocation in Windows implementation
- Refactors Linux implementation to use memcpy instead of strcat for better performance and adds safety checks
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| windows/system_date_time_format_plugin.cpp | Implements dynamic buffer allocation and converts 'tt' pattern to 'a' after retrieving locale information |
| linux/system_date_time_format_plugin.cc | Refactors format_date and format_time functions to use 'a' pattern, adds null checks, bounds checking, and replaces strcat with memcpy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Windows: Replace 'tt' pattern with 'a' after retrieving format from system - Windows: Use dynamic buffer allocation instead of fixed 80-char buffer - Linux: Change %p and %r patterns to use 'a' instead of 'tt' - Linux: Improve performance by replacing strcat() with memcpy() - Linux: Add null checks and bounds checking for better memory safety - Linux: Fix edge case where input could end with '%' This ensures compatibility with standard date/time format patterns used by Flutter/Dart, where 'a' represents AM/PM designator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…30) * Initial plan * Replace magic number with MAX_REPLACEMENT_LENGTH constant Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com> * Complete feedback implementation Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com> * Update linux/system_date_time_format_plugin.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com> Co-authored-by: Dominik Krajcer <dom.kraj@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This ensures compatibility with standard date/time format patterns used by Flutter/Dart, where 'a' represents AM/PM designator.