We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f434683 commit 1f130e1Copy full SHA for 1f130e1
src/runtime/utils/text.ts
@@ -110,15 +110,15 @@ export const formatPhone = (input: string, separator = '-') => {
110
return phone
111
}
112
113
-export function formatDate(date: string, locale = 'en-us') {
+export function formatDate(date: number | string | Date, locale = 'en-us') {
114
return new Date(date).toLocaleDateString(locale, {
115
year: 'numeric',
116
month: 'long',
117
day: 'numeric',
118
})
119
120
121
-export function formatDateTime(date: string, locale = 'en-us') {
+export function formatDateTime(date: number | string | Date, locale = 'en-us') {
122
return new Date(date).toLocaleString(locale, {
123
124
0 commit comments