@momo-kits/calendar 0.73.3-beta.5 → 0.74.2-react-native.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CalendarPro.tsx +390 -0
- package/Day.tsx +221 -0
- package/HeaderControl.tsx +55 -0
- package/{src/LunarDateConverter.js → LunarDateConverter.ts} +43 -27
- package/{src/LunarService.js → LunarService.ts} +16 -10
- package/Month.tsx +114 -0
- package/{src/MonthList.js → MonthList.tsx} +96 -62
- package/TabHeader.tsx +90 -0
- package/{src/Util.js → Util.ts} +45 -57
- package/{src/holidayData.js → holidayData.ts} +20 -20
- package/{src/Calendar.js → index.tsx} +133 -182
- package/package.json +13 -13
- package/styles.ts +123 -0
- package/types.ts +200 -0
- package/index.js +0 -4
- package/src/CalendarPro.js +0 -436
- package/src/Day/index.js +0 -233
- package/src/Day/style.js +0 -127
- package/src/HeaderControl.js +0 -83
- package/src/Month/index.js +0 -89
- package/src/Month/style.js +0 -0
- package/src/TabHeader.js +0 -72
- package/src/calendarPicker/Day.js +0 -146
- package/src/calendarPicker/Days.js +0 -230
- package/src/calendarPicker/HeaderControls.js +0 -167
- package/src/calendarPicker/WeekDaysLabels.js +0 -27
- package/src/calendarPicker/index.js +0 -125
- package/src/calendarPicker/styles.js +0 -183
- package/src/calendarPicker/util.js +0 -84
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import {Dimensions, StyleSheet} from 'react-native';
|
|
2
|
-
|
|
3
|
-
const widthScreen = Dimensions.get('window').width;
|
|
4
|
-
|
|
5
|
-
const styles = StyleSheet.create({
|
|
6
|
-
calendar: {
|
|
7
|
-
// height:widthScreen - 20,
|
|
8
|
-
backgroundColor: 'white',
|
|
9
|
-
borderColor: '#DADADA',
|
|
10
|
-
borderBottomWidth: 1,
|
|
11
|
-
borderTopWidth: 1,
|
|
12
|
-
},
|
|
13
|
-
dayWrapper: {
|
|
14
|
-
width: widthScreen / 7,
|
|
15
|
-
height: 40,
|
|
16
|
-
backgroundColor: 'rgba(0,0,0,0.0)',
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
dayButton: {
|
|
20
|
-
width: 50,
|
|
21
|
-
height: 50,
|
|
22
|
-
alignSelf: 'center',
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
styleFirstDate: {
|
|
26
|
-
position: 'absolute',
|
|
27
|
-
// width:45,
|
|
28
|
-
height: 40,
|
|
29
|
-
top: 0,
|
|
30
|
-
left: widthScreen / 14,
|
|
31
|
-
right: -1,
|
|
32
|
-
backgroundColor: '#90d6f3',
|
|
33
|
-
borderRadius: 0,
|
|
34
|
-
},
|
|
35
|
-
styleSecondDate: {
|
|
36
|
-
position: 'absolute',
|
|
37
|
-
// width:45,
|
|
38
|
-
height: 40,
|
|
39
|
-
top: 0,
|
|
40
|
-
right: widthScreen / 14,
|
|
41
|
-
left: 0,
|
|
42
|
-
backgroundColor: '#90d6f3',
|
|
43
|
-
borderRadius: 0,
|
|
44
|
-
},
|
|
45
|
-
styleBetween: {
|
|
46
|
-
height: 40,
|
|
47
|
-
// width:60,
|
|
48
|
-
top: 0,
|
|
49
|
-
left: 0,
|
|
50
|
-
right: -1,
|
|
51
|
-
position: 'absolute',
|
|
52
|
-
backgroundColor: '#90d6f3',
|
|
53
|
-
borderRadius: 0,
|
|
54
|
-
},
|
|
55
|
-
dayButtonSelected: {
|
|
56
|
-
width: 40,
|
|
57
|
-
height: 40,
|
|
58
|
-
borderRadius: 20,
|
|
59
|
-
backgroundColor: '#2eb3e8',
|
|
60
|
-
alignSelf: 'center',
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
dayButtonNow: {
|
|
64
|
-
width: 40,
|
|
65
|
-
height: 40,
|
|
66
|
-
borderRadius: 20,
|
|
67
|
-
backgroundColor: '#8F8E94',
|
|
68
|
-
alignSelf: 'center',
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
dayLabel: {
|
|
72
|
-
fontSize: 16,
|
|
73
|
-
color: '#393939',
|
|
74
|
-
marginTop: 10,
|
|
75
|
-
alignSelf: 'center',
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
dayLabelsWrapper: {
|
|
79
|
-
width: widthScreen,
|
|
80
|
-
flexDirection: 'row',
|
|
81
|
-
marginBottom: 10,
|
|
82
|
-
paddingTop: 5,
|
|
83
|
-
paddingBottom: 5,
|
|
84
|
-
borderColor: '#DADADA',
|
|
85
|
-
borderBottomWidth: 1,
|
|
86
|
-
borderTopWidth: 1,
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
daysWrapper: {
|
|
90
|
-
alignSelf: 'center',
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
dayLabels: {
|
|
94
|
-
width: widthScreen / 7,
|
|
95
|
-
fontSize: 12,
|
|
96
|
-
color: '#000',
|
|
97
|
-
textAlign: 'center',
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
selectedDay: {
|
|
101
|
-
width: 60,
|
|
102
|
-
height: 60,
|
|
103
|
-
backgroundColor: '#5ce600',
|
|
104
|
-
borderRadius: 30,
|
|
105
|
-
alignSelf: 'center',
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
monthLabel: {
|
|
109
|
-
fontSize: widthScreen > 320 ? 20 : 17,
|
|
110
|
-
fontWeight: '300',
|
|
111
|
-
color: '#000',
|
|
112
|
-
width: 180,
|
|
113
|
-
textAlign: 'center',
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
headerWrapper: {
|
|
117
|
-
width: widthScreen,
|
|
118
|
-
alignItems: 'center',
|
|
119
|
-
justifyContent: 'space-between',
|
|
120
|
-
flexDirection: 'row',
|
|
121
|
-
marginVertical: 10,
|
|
122
|
-
backgroundColor: 'rgba(0,0,0,0.0)',
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
monthSelector: {
|
|
126
|
-
width: 80,
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
prev: {
|
|
130
|
-
textAlign: 'left',
|
|
131
|
-
fontSize: 16,
|
|
132
|
-
color: '#dadada',
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
next: {
|
|
136
|
-
textAlign: 'right',
|
|
137
|
-
fontSize: 16,
|
|
138
|
-
color: '#dadada',
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
yearLabel: {
|
|
142
|
-
fontSize: 14,
|
|
143
|
-
fontWeight: 'bold',
|
|
144
|
-
color: '#000',
|
|
145
|
-
textAlign: 'center',
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
weeks: {
|
|
149
|
-
flexDirection: 'column',
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
weekRow: {
|
|
153
|
-
flexDirection: 'row',
|
|
154
|
-
},
|
|
155
|
-
btnCellHeader: {
|
|
156
|
-
flex: 1,
|
|
157
|
-
justifyContent: 'center',
|
|
158
|
-
alignItems: 'center',
|
|
159
|
-
borderWidth: 1,
|
|
160
|
-
borderColor: '#DADADA',
|
|
161
|
-
backgroundColor: 'white',
|
|
162
|
-
},
|
|
163
|
-
center: {
|
|
164
|
-
justifyContent: 'center',
|
|
165
|
-
alignItems: 'center',
|
|
166
|
-
},
|
|
167
|
-
txtDate: {
|
|
168
|
-
color: '#4D4D4D',
|
|
169
|
-
fontSize: 18,
|
|
170
|
-
fontWeight: 'bold',
|
|
171
|
-
paddingVertical: 10,
|
|
172
|
-
},
|
|
173
|
-
lineActiveTab: {
|
|
174
|
-
height: 3,
|
|
175
|
-
width: '100%',
|
|
176
|
-
position: 'absolute',
|
|
177
|
-
bottom: 0,
|
|
178
|
-
left: 0,
|
|
179
|
-
backgroundColor: '#49A3BC',
|
|
180
|
-
},
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
export default styles;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {SwitchLanguage} from '@momo-kits/core';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
WEEKDAYS: SwitchLanguage.getLocalize({
|
|
5
|
-
vi: ['T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'CN'],
|
|
6
|
-
en: ['Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'],
|
|
7
|
-
}),
|
|
8
|
-
|
|
9
|
-
WEEKDAYSNAME: [
|
|
10
|
-
'Thứ 2',
|
|
11
|
-
'Thứ 3',
|
|
12
|
-
'Thứ 4',
|
|
13
|
-
'Thứ 5',
|
|
14
|
-
'Thứ 6',
|
|
15
|
-
'Thứ 7',
|
|
16
|
-
'Chủ nhật',
|
|
17
|
-
],
|
|
18
|
-
|
|
19
|
-
MONTHS: SwitchLanguage.getLocalize({
|
|
20
|
-
vi: [
|
|
21
|
-
'Tháng 1',
|
|
22
|
-
'Tháng 2',
|
|
23
|
-
'Tháng 3',
|
|
24
|
-
'Tháng 4',
|
|
25
|
-
'Tháng 5',
|
|
26
|
-
'Tháng 6',
|
|
27
|
-
'Tháng 7',
|
|
28
|
-
'Tháng 8',
|
|
29
|
-
'Tháng 9',
|
|
30
|
-
'Tháng 10',
|
|
31
|
-
'Tháng 11',
|
|
32
|
-
'Tháng 12',
|
|
33
|
-
],
|
|
34
|
-
en: [
|
|
35
|
-
'Jan',
|
|
36
|
-
'Feb',
|
|
37
|
-
'Mar',
|
|
38
|
-
'Apr',
|
|
39
|
-
'May',
|
|
40
|
-
'Jun',
|
|
41
|
-
'Jul',
|
|
42
|
-
'Aug',
|
|
43
|
-
'Sep',
|
|
44
|
-
'Oct',
|
|
45
|
-
'Nov',
|
|
46
|
-
'Dec',
|
|
47
|
-
],
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
MAX_ROWS: 7,
|
|
51
|
-
|
|
52
|
-
MAX_COLUMNS: 7,
|
|
53
|
-
|
|
54
|
-
getDaysInMonth(month, year) {
|
|
55
|
-
const lastDayOfMonth = new Date(year, month + 1, 0);
|
|
56
|
-
return lastDayOfMonth.getDate();
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
getDayofDate(date) {
|
|
60
|
-
const WEEKDAYSNAME = [
|
|
61
|
-
'Thứ hai',
|
|
62
|
-
'Thứ ba',
|
|
63
|
-
'Thứ tư',
|
|
64
|
-
'Thứ năm',
|
|
65
|
-
'Thứ sáu',
|
|
66
|
-
'Thứ bảy',
|
|
67
|
-
'Chủ nhật',
|
|
68
|
-
];
|
|
69
|
-
let day = date.getDay();
|
|
70
|
-
if (date.getDay() === 0) {
|
|
71
|
-
day = 7;
|
|
72
|
-
}
|
|
73
|
-
return WEEKDAYSNAME[day - 1];
|
|
74
|
-
},
|
|
75
|
-
formatDate(date) {
|
|
76
|
-
const padding = input => `${input > 9 ? input : `0${input}`}`;
|
|
77
|
-
if (date && typeof date.getDate === 'function') {
|
|
78
|
-
return `${padding(date.getDate())}/${padding(date.getMonth() + 1)}/${date
|
|
79
|
-
.getFullYear()
|
|
80
|
-
.toString()}`;
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
},
|
|
84
|
-
};
|