mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
WIP(translate): translate web and math category all tools
This commit is contained in:
parent
4f550a9499
commit
a2e498d0aa
37 changed files with 406 additions and 119 deletions
|
@ -1,6 +1,7 @@
|
|||
import { formatDuration } from 'date-fns';
|
||||
import type { Locale } from 'date-fns';
|
||||
|
||||
export function formatMsDuration(duration: number) {
|
||||
export function formatMsDuration(duration: number, locale: Locale) {
|
||||
const ms = Math.floor(duration % 1000);
|
||||
const secs = Math.floor(((duration - ms) / 1000) % 60);
|
||||
const mins = Math.floor((((duration - ms) / 1000 - secs) / 60) % 60);
|
||||
|
@ -11,6 +12,6 @@ export function formatMsDuration(duration: number) {
|
|||
hours: hrs,
|
||||
minutes: mins,
|
||||
seconds: secs,
|
||||
}) + (ms > 0 ? ` ${ms} ms` : '')
|
||||
}, { locale }) + (ms > 0 ? ` ${ms} ms` : '')
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue