Skip to content

F2592 locale date time#37

Open
shewitt-au wants to merge 72 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time
Open

F2592 locale date time#37
shewitt-au wants to merge 72 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time

Conversation

@shewitt-au
Copy link
Copy Markdown
Contributor

@shewitt-au shewitt-au commented Mar 9, 2026

Problem description

In ImHex Dates and times currently have a fixed format and do not respect the selected language. MinGW’s (Windows) std::locale class is broken and basically useless. This PR implements, along with the ImHex PR linked below, date and time formatting using the Win32 API on Windows and the C runtime library on other OSes.

The motivating feature request can be found here:
Format time based on locale #2592

The corresponding ImHex changes and links to other dependant PRs can be found here:
ImHex changes

Implementation description

Three new files have been added:

  1. "soo_buffer.hpp" in utiils. A buffer for POD types that keeps small allocations on the stack and transparently moves to heap storage when the size exceeds a configurable limit. During reallocation, the contents of the previous buffer may optionally be copied to the new one.
  2. "date_time_format.hpp". A header file for new date and time formatting functions.
  3. "date_time_format.cpp". The implementation of the new formatting function. On Windows some functions are also exposed that are used by the Windows version of the main formatting function.

@shewitt-au shewitt-au marked this pull request as ready for review March 11, 2026 15:28
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 3, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.97%. Comparing base (c910871) to head (c1e2fcf).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
libs/utils/source/utils/date_time_format.cpp 0.00% 120 Missing ⚠️
libs/utils/include/wolv/utils/date_time_format.hpp 0.00% 4 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #37       +/-   ##
===========================================
- Coverage   64.35%   51.97%   -12.38%     
===========================================
  Files          16       18        +2     
  Lines         606      758      +152     
  Branches      102      133       +31     
===========================================
+ Hits          390      394        +4     
- Misses        184      321      +137     
- Partials       32       43       +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants