about summary refs log tree commit diff
path: root/src/components/forms/DateField/utils.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-08-29 19:22:53 -0500
committerGitHub <noreply@github.com>2024-08-29 19:22:53 -0500
commit8651f31ebb7cf9c6a0949503f2c2c5755328ce46 (patch)
tree04f9c08a3770cee554a6cd421a53dc04957457fb /src/components/forms/DateField/utils.ts
parentd5a76183746bc67f88b858add49c2dba52b99bb5 (diff)
downloadvoidsky-8651f31ebb7cf9c6a0949503f2c2c5755328ce46.tar.zst
Localize dates, counts (#5027)
* refactor: consistent localized formatting

* refactor: localized date time

* refactor: localize relative time with strings

* chore: fix typo from copy-paste

* Clean up useTimeAgo

* Remove old ago

* Const

* Reuse

* Prettier

---------

Co-authored-by: Mary <git@mary.my.id>
Diffstat (limited to 'src/components/forms/DateField/utils.ts')
-rw-r--r--src/components/forms/DateField/utils.ts11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/components/forms/DateField/utils.ts b/src/components/forms/DateField/utils.ts
index c787272fe..04bb482ce 100644
--- a/src/components/forms/DateField/utils.ts
+++ b/src/components/forms/DateField/utils.ts
@@ -1,16 +1,5 @@
-import {getLocales} from 'expo-localization'
-
-const LOCALE = getLocales()[0]
-
 // we need the date in the form yyyy-MM-dd to pass to the input
 export function toSimpleDateString(date: Date | string): string {
   const _date = typeof date === 'string' ? new Date(date) : date
   return _date.toISOString().split('T')[0]
 }
-
-export function localizeDate(date: Date | string): string {
-  const _date = typeof date === 'string' ? new Date(date) : date
-  return new Intl.DateTimeFormat(LOCALE.languageTag, {
-    timeZone: 'UTC',
-  }).format(_date)
-}