-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add more date formats in settings #3131
Conversation
🥷 Code experts: no user but you matched threshold 10 Yusyuriv, onesounds have most 🧠 knowledge in the files. See details
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
📝 WalkthroughWalkthroughThe pull request introduces two new date format options ( Changes
Assessment against linked issues
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs (1)
135-137
: LGTM! The new date formats are valid and well-integrated.The added date formats follow the correct DateTime format string syntax and are consistent with the existing formats in the list. They provide good options for European date representation.
Consider moving these format strings to a resource file or constants to improve maintainability and enable localization if needed in the future. Example:
public List<string> DateFormatList { get; } = new() { - "MM'/'dd dddd", - // ... other formats ... - "dd.MM.yy", - "dd.MM.yyyy" + DateTimeFormats.MonthDayLong, + // ... other formats ... + DateTimeFormats.EuropeanShort, + DateTimeFormats.EuropeanLong };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs
(1 hunks)
🔇 Additional comments (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs (1)
135-137
: Verify date format preview functionality
Please ensure that the preview functionality correctly displays these new date formats across different cultures.
✅ Verification successful
Let me check the implementation details of the date format preview functionality.
Let me try a different approach to check the implementation details.
The new date formats are safely integrated
The implementation correctly handles culture-specific formatting:
- DateText property uses CultureInfo.CurrentUICulture for proper localization
- DateTimeFormatToNowConverter provides preview functionality
- The formats follow standard DateTime pattern strings that work across cultures
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for preview-related code and date format usage
rg -l "DateFormat|CultureInfo" --type cs
# Check for any culture-specific handling in tests
rg -l "TestCulture|CultureInfo.*CurrentUICulture" --type cs
Length of output: 2119
Script:
#!/bin/bash
# Check the implementation of date format preview and culture handling
ast-grep --pattern 'class SettingsPaneThemeViewModel {
$$$
DateText $$$
$$$
}'
# Check the date format converter implementation
ast-grep --pattern 'class DateTimeFormatToNowConverter {
$$$
}'
# Check settings implementation for date format
ast-grep --pattern 'class Settings {
$$$
DateFormat $$$
$$$
}'
Length of output: 225
Script:
#!/bin/bash
# Check the implementation details of the date format handling
rg "DateText" -A 5 -B 5 Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs
# Check the converter implementation
rg "Convert" -A 10 Flow.Launcher/Converters/DateTimeFormatToNowConverter.cs
# Check how date format is used in settings
rg "DateFormat" -A 3 -B 3 Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Length of output: 1411
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
Closes #3128.
This PR adds two more date format options to settings:
dd.MM.yy
(15.12.24
)dd.MM.yyyy
(15.12.2024
)I tested: