Skip to content

146 support different timedate format#178

Merged
AlixANNERAUD merged 4 commits intomainfrom
146-support-different-timedate-format
Mar 25, 2026
Merged

146 support different timedate format#178
AlixANNERAUD merged 4 commits intomainfrom
146-support-different-timedate-format

Conversation

@AlixANNERAUD
Copy link
Copy Markdown
Contributor

@AlixANNERAUD AlixANNERAUD commented Mar 25, 2026

This pull request introduces a new internationalized time formatting utility, refactors time decomposition logic for clarity and correctness (especially for negative Unix timestamps), and updates code to use these new utilities. The changes improve maintainability, correctness, and enable locale-independent time formatting throughout the codebase.

Internationalization and Time Formatting

  • Added a new format_unix_timestamp function in modules/internationalization/src/time.rs that formats Unix timestamps using Python-like strftime tokens, supporting common date/time patterns and locale-independent AM/PM formatting. Includes tests. (modules/internationalization/src/time.rs, modules/internationalization/Cargo.toml, [1] [2]
  • Replaced direct time formatting in executables/shell/graphical/src/layout.rs with the new internationalization::format_unix_timestamp utility. (executables/shell/graphical/src/layout.rs, [1] [2]

Time Decomposition Refactor

  • Renamed and improved the function for breaking down Unix timestamps: unix_to_human_time is now decompose_unix_timestamp, with more robust handling of negative timestamps (dates before 1970). Added comprehensive tests for edge cases and leap years. (modules/shared/src/time.rs, [1] [2] [3]
  • Updated all usages of the old function to use the new decompose_unix_timestamp name, including in file system time display logic. (modules/file_system/src/time.rs, [1] [2]

Minor Dependency and Module Updates

@AlixANNERAUD AlixANNERAUD linked an issue Mar 25, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 88.37209% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
modules/internationalization/src/time.rs 87.75% 6 Missing ⚠️
executables/shell/graphical/src/layout.rs 0.00% 3 Missing ⚠️
modules/shared/src/time.rs 96.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AlixANNERAUD AlixANNERAUD enabled auto-merge (squash) March 25, 2026 20:50
@AlixANNERAUD AlixANNERAUD force-pushed the 146-support-different-timedate-format branch from a2569e7 to 15e04cf Compare March 25, 2026 20:51
@AlixANNERAUD AlixANNERAUD merged commit 8a20add into main Mar 25, 2026
1 check passed
@AlixANNERAUD AlixANNERAUD deleted the 146-support-different-timedate-format branch March 25, 2026 21:41
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.

Support different time/date format

1 participant