@@ -10,7 +10,7 @@ export interface UseDateFormatOptions {
1010 *
1111 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
1212 */
13- locales ?: Intl . LocalesArgument
13+ locales ?: MaybeRefOrGetter < Intl . LocalesArgument >
1414
1515 /**
1616 * A custom function to re-modify the way to display meridiem
@@ -53,8 +53,8 @@ export function formatDate(date: Date, formatStr: string, options: UseDateFormat
5353 M : ( ) => month + 1 ,
5454 Mo : ( ) => formatOrdinal ( month + 1 ) ,
5555 MM : ( ) => `${ month + 1 } ` . padStart ( 2 , '0' ) ,
56- MMM : ( ) => date . toLocaleDateString ( options . locales , { month : 'short' } ) ,
57- MMMM : ( ) => date . toLocaleDateString ( options . locales , { month : 'long' } ) ,
56+ MMM : ( ) => date . toLocaleDateString ( toValue ( options . locales ) , { month : 'short' } ) ,
57+ MMMM : ( ) => date . toLocaleDateString ( toValue ( options . locales ) , { month : 'long' } ) ,
5858 D : ( ) => String ( days ) ,
5959 Do : ( ) => formatOrdinal ( days ) ,
6060 DD : ( ) => `${ days } ` . padStart ( 2 , '0' ) ,
@@ -72,9 +72,9 @@ export function formatDate(date: Date, formatStr: string, options: UseDateFormat
7272 ss : ( ) => `${ seconds } ` . padStart ( 2 , '0' ) ,
7373 SSS : ( ) => `${ milliseconds } ` . padStart ( 3 , '0' ) ,
7474 d : ( ) => day ,
75- dd : ( ) => date . toLocaleDateString ( options . locales , { weekday : 'narrow' } ) ,
76- ddd : ( ) => date . toLocaleDateString ( options . locales , { weekday : 'short' } ) ,
77- dddd : ( ) => date . toLocaleDateString ( options . locales , { weekday : 'long' } ) ,
75+ dd : ( ) => date . toLocaleDateString ( toValue ( options . locales ) , { weekday : 'narrow' } ) ,
76+ ddd : ( ) => date . toLocaleDateString ( toValue ( options . locales ) , { weekday : 'short' } ) ,
77+ dddd : ( ) => date . toLocaleDateString ( toValue ( options . locales ) , { weekday : 'long' } ) ,
7878 A : ( ) => meridiem ( hours , minutes ) ,
7979 AA : ( ) => meridiem ( hours , minutes , false , true ) ,
8080 a : ( ) => meridiem ( hours , minutes , true ) ,
0 commit comments