1
+ import { t } from '../localizedFormat'
2
+
1
3
export default ( o , c , dayjs ) => { // locale needed later
2
4
const proto = c . prototype
3
5
const getLocalePart = part => ( part && ( part . indexOf ? part : part . s ) )
@@ -11,6 +13,9 @@ export default (o, c, dayjs) => { // locale needed later
11
13
return result . map ( ( _ , index ) => ( result [ ( index + ( weekStart || 0 ) ) % 7 ] ) )
12
14
}
13
15
const getDayjsLocaleObject = ( ) => dayjs . Ls [ dayjs . locale ( ) ]
16
+ const getLongDateFormat = ( l , format ) =>
17
+ l . formats [ format ] || t ( l . formats [ format . toUpperCase ( ) ] )
18
+
14
19
const localeData = function ( ) {
15
20
return {
16
21
months : instance =>
@@ -23,7 +28,8 @@ export default (o, c, dayjs) => { // locale needed later
23
28
( instance ? instance . format ( 'dd' ) : getShort ( this , 'weekdaysMin' , 'weekdays' , 2 ) ) ,
24
29
weekdaysShort : instance =>
25
30
( instance ? instance . format ( 'ddd' ) : getShort ( this , 'weekdaysShort' , 'weekdays' , 3 ) ) ,
26
- longDateFormat : format => this . $locale ( ) . formats [ format ]
31
+ longDateFormat : format => getLongDateFormat ( this . $locale ( ) , format )
32
+
27
33
}
28
34
}
29
35
proto . localeData = function ( ) {
@@ -39,7 +45,7 @@ export default (o, c, dayjs) => { // locale needed later
39
45
weekdaysMin : ( ) => dayjs . weekdaysMin ( ) ,
40
46
months : ( ) => dayjs . months ( ) ,
41
47
monthsShort : ( ) => dayjs . monthsShort ( ) ,
42
- longDateFormat : format => localeObject . formats [ format ]
48
+ longDateFormat : format => getLongDateFormat ( localeObject , format )
43
49
}
44
50
}
45
51
0 commit comments