@momo-kits/calendar 0.0.73-beta → 0.72.1

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