@gradio/utils
Advanced tools
Comparing version 0.2.1 to 0.2.2
# @gradio/utils | ||
## 0.2.2 | ||
### Features | ||
- [#7274](https://github.com/gradio-app/gradio/pull/7274) [`fdd1521`](https://github.com/gradio-app/gradio/commit/fdd15213c24b9cbc58bbc1b6beb4af7c18f48557) - chore: Change time format (thanks @jjshoots for the independent contribution). Thanks [@arian81](https://github.com/arian81)! | ||
## 0.2.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@gradio/utils", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Gradio UI packages", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -154,2 +154,17 @@ import type { ActionReturn } from "svelte/action"; | ||
export const format_time = (seconds: number): string => { | ||
const hours = Math.floor(seconds / 3600); | ||
const minutes = Math.floor((seconds % 3600) / 60); | ||
const seconds_remainder = Math.round(seconds) % 60; | ||
const padded_minutes = `${minutes < 10 ? "0" : ""}${minutes}`; | ||
const padded_seconds = `${ | ||
seconds_remainder < 10 ? "0" : "" | ||
}${seconds_remainder}`; | ||
if (hours > 0) { | ||
return `${hours}:${padded_minutes}:${padded_seconds}`; | ||
} | ||
return `${minutes}:${padded_seconds}`; | ||
}; | ||
export type I18nFormatter = any; | ||
@@ -156,0 +171,0 @@ export class Gradio<T extends Record<string, any> = Record<string, any>> { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21136
181