Skip to content

Commit 2a95e6a

Browse files
committed
remove!: timestampToString in favor of formatDate
Use .toDate()
1 parent f095607 commit 2a95e6a

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/runtime/utils/firebase.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,6 @@ export function getFirebaseConsoleUrl(
4141
return firebaseConsoleUrl
4242
}
4343

44-
export function timestampToString(
45-
timestamp: Timestamp,
46-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options
47-
options = <Intl.DateTimeFormatOptions>{
48-
year: 'numeric',
49-
month: 'short',
50-
day: 'numeric',
51-
hour: 'numeric',
52-
minute: 'numeric',
53-
},
54-
defaultString = '-',
55-
locale = 'en-US',
56-
) {
57-
if (timestamp && timestamp.seconds) {
58-
return timestamp.toDate().toLocaleString(locale, options) || defaultString
59-
}
60-
else {
61-
return defaultString
62-
}
63-
}
64-
6544
export function timestampToISOString(
6645
timestamp: Timestamp,
6746
defaultString = '-',

0 commit comments

Comments
 (0)