Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Remove unused functions

Blue Mousec6066dc614fc
diff --git a/web/app/utils/date.ts b/web/app/utils/date.ts
index ca4e81e2e..205f5544a 100644
--- a/web/app/utils/date.ts
+++ b/web/app/utils/date.ts
@@ -27,20 +27,6 @@ const formatTimeAgo = (date, language?: string) => {
}
}
-export const formatTime = (
- value: number,
- unit: Intl.RelativeTimeFormatUnit,
- language = 'en',
- style: Intl.RelativeTimeFormatStyle = 'short',
-) => {
- const rtf = new Intl.RelativeTimeFormat(language, { numeric: 'always', style })
-
- const formatted = rtf.format(value, unit)
-
- // Remove the 'in' prefix (and it's alternatives in other languages)
- return formatted.replace(/^.*?(\d+)/, '$1').trim()
-}
-
export const getRelativeDateIfPossible = (date: string, language?: string) => {
if (!Intl?.RelativeTimeFormat) {
return new Date(date).toLocaleDateString(language, {
diff --git a/web/app/utils/validator.ts b/web/app/utils/validator.ts
index dfd18665a..4d6c8914d 100644
--- a/web/app/utils/validator.ts
+++ b/web/app/utils/validator.ts
@@ -4,12 +4,3 @@ export const MAX_PASSWORD_CHARS = 50
export const isValidEmail = (text: string) => text.match(/^\S+@\S+\.\S+$/)
export const isValidPassword = (text: string) => text.length >= MIN_PASSWORD_CHARS
-
-export const isValidUrl = (text: string) => {
- try {
- new URL(text)
- return true
- } catch {
- return false
- }
-}