File tree 6 files changed +18
-14
lines changed
6 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue3-hash-calendar" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"author" : " HashTang" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -871,8 +871,9 @@ export default defineComponent({
871
871
{ item . map ( ( date , j ) => (
872
872
< div
873
873
class = { `calendar_item ${
874
- formatDisabledDate ( date ) &&
875
- ( props . disabledClassName || 'calendar_item_disable' )
874
+ formatDisabledDate ( date )
875
+ ? props . disabledClassName || 'calendar_item_disable'
876
+ : ''
876
877
} `}
877
878
ref = { ( el ) => {
878
879
calendarItemRef . length = 0 ;
Original file line number Diff line number Diff line change 158
158
.fontSize (28px );
159
159
.flexContent ();
160
160
margin-bottom : 8px ;
161
+ .mainFontColor (color );
161
162
}
162
163
163
164
.calendar_first_today {
Original file line number Diff line number Diff line change 4
4
* @CreateDate : 2020/3/22 22:01
5
5
*/
6
6
7
- import CN from " ./cn" ;
8
- import EN from " ./en" ;
7
+ import CN from ' ./cn' ;
8
+ import EN from ' ./en' ;
9
9
10
10
export type LanguageEntityType = {
11
11
CONFIRM : string ;
@@ -16,7 +16,7 @@ export type LanguageEntityType = {
16
16
DEFAULT_TIME_FORMAT : string ;
17
17
} ;
18
18
19
- export const LanguageTypes = [ "CN" , "EN" ] as const ;
19
+ export const LanguageTypes = [ 'CN' , 'EN' ] as const ;
20
20
21
21
export type LanguageType = typeof LanguageTypes [ number ] ;
22
22
Original file line number Diff line number Diff line change 1
1
import { isLeap } from '.' ;
2
+ import language from '../language' ;
3
+ import { LangType } from '../types' ;
2
4
3
5
/**
4
6
* 日期格式化
@@ -9,14 +11,12 @@ import { isLeap } from '.';
9
11
export const formatDate = function (
10
12
time : Date | string ,
11
13
format : string ,
12
- lang = 'CN'
14
+ lang : LangType = 'CN'
13
15
) {
14
- lang = lang . toUpperCase ( ) ;
15
- const models = import . meta. globEager ( '../language/index.ts' ) ;
16
- const model : any = models [ Object . keys ( models ) [ 0 ] ] ;
17
- const language = model . default [ lang ] || { } ;
16
+ const languageEntiy = language [ lang ] || { } ;
18
17
format =
19
- format || `${ language . DEFAULT_DATE_FORMAT } ${ language . DEFAULT_TIME_FORMAT } ` ;
18
+ format ||
19
+ `${ languageEntiy . DEFAULT_DATE_FORMAT } ${ languageEntiy . DEFAULT_TIME_FORMAT } ` ;
20
20
const date = time ? new Date ( time ) : new Date ( ) ;
21
21
const year = date . getFullYear ( ) ;
22
22
const month = date . getMonth ( ) + 1 ; // 月份是从0开始的
@@ -43,7 +43,9 @@ export const formatDate = function (
43
43
. replace ( / D D / g, preArr [ day ] || day + '' )
44
44
. replace (
45
45
/ M M / g,
46
- lang === 'EN' ? language . MONTH [ month - 1 ] : preArr [ month ] || month
46
+ lang === 'EN'
47
+ ? languageEntiy . MONTH [ month - 1 ]
48
+ : preArr [ month ] || month + ''
47
49
) ;
48
50
49
51
return newTime ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export default {
50
50
site : {
51
51
publicPath : '/calendar/' ,
52
52
} ,
53
- // srcDir: process.env.BUILD_TARGET === 'site' ? './src' : './src/calendar',
53
+ srcDir : process . env . BUILD_TARGET === 'site' ? './src' : './src/calendar' ,
54
54
} ,
55
55
site : {
56
56
title : 'vue3-hash-calendar' ,
You can’t perform that action at this time.
0 commit comments