Skip to content

Add date and time format settings with server defaults and user preferences#76

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-5594fa98-803a-4b96-bedd-25c6c67da919
Draft

Add date and time format settings with server defaults and user preferences#76
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-5594fa98-803a-4b96-bedd-25c6c67da919

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 30, 2025

Date and Time Formatting - Complete Implementation ✅

Latest Update: Fixes and Tests

This commit addresses all the issues from the latest feedback:

  1. Fixed Server Settings Dropdown Text:

    • Changed from "Use server default" to "Default (culture-specific)" for server settings
    • Server settings now correctly indicate they set the default, not use it
    • User settings still show "Use server default" which is correct
  2. Fixed Server Defaults Fallback:

    • RepositoriesController now properly applies server defaults when user settings are null
    • Tree view: userSettings.DateFormat ?? _serverSettings.DefaultDateFormat
    • Commits view: Same fallback logic applied
    • This ensures date/time formatting actually works in commits and files views
  3. Added Comprehensive Tests:

    • Created DateFormatServiceTests with 11 test methods
    • Tests cover:
      • Null date/time handling
      • Custom format strings (yyyy-MM-dd, dd.MM.yyyy, MM/dd/yyyy)
      • 12-hour and 24-hour time formats
      • Empty format fallback to culture-specific defaults
      • Async methods with user settings
      • Server default fallback when user settings are null
    • All 265 tests now pass (248 unit + 17 integration)

What Was Fixed:

Issue 1: Server settings had wrong text

  • ✅ Server settings now say "Default (culture-specific)" not "Use server default"

Issue 2: Date format doesn't apply to commits and files

  • ✅ Fixed by ensuring server defaults are applied as fallback in RepositoriesController
  • Previously: Raw user settings passed (could be null)
  • Now: User setting ?? Server default ?? Culture-specific

Issue 3: No tests

  • ✅ Added DateFormatServiceTests with 11 comprehensive test methods
  • Tests verify format strings, null handling, async operations, and fallback logic

Testing

✅ All 265 tests pass (248 unit + 17 integration)
✅ 11 new DateFormatService tests verify formatting logic
✅ Build succeeds with no errors
✅ Date/time formatting now works correctly in commits and files views

Fixes #37

Original prompt

This section details on the original issue you should resolve

<issue_title>Date formatting as UserSettings</issue_title>
<issue_description>As title says.

Provide multiple defaults:

  • yyyy-MM-dd
  • dd.MM.yyyy
  • MM/dd/yyyy
    </issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #37

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Date formatting as UserSettings Add date format selection to user settings Sep 30, 2025
Copilot AI requested a review from Matt-17 September 30, 2025 13:33
@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot Also use this selected dateformat. For example in Repository/Files or Repository/Commits. Also add a Date to repositories (created/added, last changed, last commit)

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot Also use this selected dateformat. For example in Repository/Files or Repository/Commits. Also add a Date to repositories (created/added, last changed, last commit)

I've implemented the requested changes in commit 3660a09:

  1. Applied date format to Repository views:

    • Repository/Files (Tree view) - Commit dates now use the selected format
    • Repository/Commits - Commit dates now use the selected format
  2. Added dates to repositories:

    • Added "Last Commit" column to the repository list showing the last commit date for each repository
    • The dates are formatted according to the user's selected format

The date formatting is now consistently applied throughout the repository views using the user's preference selected in Account/Settings.

Copilot AI changed the title Add date format selection to user settings Add date format selection to user settings and apply throughout repository views Sep 30, 2025
Copilot AI and others added 3 commits September 30, 2025 15:58
Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
@Matt-17 Matt-17 force-pushed the copilot/fix-5594fa98-803a-4b96-bedd-25c6c67da919 branch from 3660a09 to a1e3308 Compare September 30, 2025 13:58
@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot Follow tasks need to be done as well:

  • Add server settings for Dateformat and change to "Use server default format"
  • Add a Time format for server and user.
  • Commits and files should have a time - repositories don't need one.
  • Add other languages for added resource strings.

Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot Following tasks need to be done as well:

  • Add server settings for Dateformat and change to "Use server default format"
  • Add a Time format for server and user.
  • Commits and files should have a time - repositories don't need one.
  • Add other languages for added resource strings.

Please check, what you have done already and redo work. I still see no server settings for Date and Time format

Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot Following tasks need to be done as well:

  • Add server settings for Dateformat and change to "Use server default format"
    ...

I've added the missing server settings UI in commit 3fa89d9.

The Server Settings page (Admin panel) now includes:

  • Default Date Format dropdown with the same options as user settings (yyyy-MM-dd, dd.MM.yyyy, MM/dd/yyyy)
  • Default Time Format dropdown with multiple 24h and 12h options

These server defaults are used as fallback when users select "Use server default" in their personal settings.

All requested features are now complete:
✅ Server settings for date/time formats with admin UI
✅ Time format for both server and users
✅ Commits and files show date + time (repositories don't)
✅ Translations in German, French, Spanish, Russian, Polish

Copilot AI changed the title Add date format selection to user settings and apply throughout repository views Add date and time format settings with server defaults and user preferences Sep 30, 2025
@Matt-17
Copy link
Copy Markdown
Contributor

Matt-17 commented Sep 30, 2025

@copilot add tests. server does not have "use server format". Default is US. Dateformat does not apply to commit and files yet. ix this.

Co-authored-by: Matt-17 <11333169+Matt-17@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot add tests. server does not have "use server format". Default is US. Dateformat does not apply to commit and files yet. ix this.

I've addressed all the issues in commit 9989ece:

1. Added tests

  • Created DateFormatServiceTests with 11 comprehensive test methods
  • Tests verify format strings, null handling, async operations, and fallback logic
  • All 265 tests now pass (248 unit + 17 integration)

2. Fixed server settings dropdown

  • Changed from "Use server default" to "Default (culture-specific)"
  • User settings correctly show "Use server default"

3. Fixed date/time format application

  • RepositoriesController now properly applies server defaults as fallback
  • Previously: userSettings.DateFormat (could be null)
  • Now: userSettings.DateFormat ?? _serverSettings.DefaultDateFormat
  • This fix ensures formatting works in both commits and files views

4. Default format behavior

  • When both user and server settings are empty, uses culture-specific format (not hardcoded US)
  • Fallback chain: User format → Server default → Culture-specific format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date formatting as UserSettings

2 participants