zhaohai666 opened a new pull request, #660:
URL: https://github.com/apache/rocketmq-dashboard/pull/660

   ## Summary
   
   Replace TODO stub implementations in format.ts with full-featured utility
   functions used across the dashboard.
   
   - `formatDateTime(date)`: Format to 'YYYY-MM-DD HH:mm:ss' with proper padding
   - `formatDate(date)`: Format to 'YYYY-MM-DD' (was a TODO returning raw 
string)
   - `formatBytes(bytes, decimals?)`: Human-readable 1024-based formatting
     (was a TODO returning raw 'X B'), handles zero and negative values
   - `formatNumber(num)`: Thousands separator formatting (e.g. 1234567 → 
'1,234,567')
   - `formatDelay(seconds, lang?)`: Duration formatting with i18n support
     (zh: "22小时55分钟", en: "22h 55m")
   - `formatPercent(value, decimals?)`: Fixed-decimal percentage formatting
   
   All functions are pure with no side effects, making them easy to test and 
reuse.
   
   ## Test plan
   
   - [ ] Verify formatDateTime handles valid dates, invalid dates, and string 
input
   - [ ] Verify formatBytes: 0 → '0 B', 1536 → '1.5 KB', 1048576 → '1 MB'
   - [ ] Verify formatDelay: 82500 → '22小时55分钟' (zh), '22h 55m' (en)
   - [ ] Verify formatPercent: 99.5 → '99.5%'


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to