Skip to content

Commit 91010f5

Browse files
hyxingyuefeng
authored andcommitted
fix: 修改报错
1 parent de678a8 commit 91010f5

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

packages/core/src/ButtonGroup/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class ButtonGroup extends Component<ButtonGroupProps> {
8080
childStyle.borderWidth = 0;
8181
}
8282
if (bordered && !gutter) {
83-
if ((idx > 0 && idx < (children as ButtonProps[]).length - 1) || idx === 0) {
83+
if (((idx > 0 && idx < (children as ButtonProps[]).length - 1)) || idx === 0) {
8484
childStyle.borderRightWidth = StyleSheet.hairlineWidth;
8585
}
8686
if (idx > 0 && idx < (children as ButtonProps[]).length) {

packages/core/src/Calendar/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { View, Text, ViewProps, TextProps, StyleSheet, TouchableOpacity, Dimensions, Platform } from 'react-native';
2+
import { View, Text, ViewProps, StyleSheet, TouchableOpacity, Dimensions, Platform } from 'react-native';
33
import Icon from '../Icon';
44
import Ellipsis from '../Ellipsis';
55
import { getMonths, getWeeksArray, daysArrProps, getType, getNameLen } from './utils';
@@ -211,9 +211,9 @@ const Calendar = (props: CalendarProps) => {
211211
setCurrentMonth(toMonth);
212212
setCurrentDays(toDays);
213213
};
214-
const goCurrentDay = (day: number) => {
215-
setCurrentDays(day);
216-
};
214+
// const goCurrentDay = (day: number) => {
215+
// setCurrentDays(day);
216+
// };
217217

218218
return (
219219
<View style={{ flex: 1, position: 'relative' }}>

packages/core/src/Calendar/lunarHolidays.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function getLunarCalendar(year: number, month: number, day: number, type?
8585
let getHoliday: CalendarProps = { lunarHolidays: '', colorType: '', lunarMonth: lunarMonth, lunar: lunar };
8686
return getHoliday;
8787
}
88-
return lunar;
88+
// return lunar;
8989
}
9090

9191
export interface lunarProps {
@@ -120,21 +120,21 @@ export function Lunar(year: number, month: number, day: number): lunarProps {
120120
isLeap = false;
121121
for (i = 1; i < 13 && offset > 0; i++) {
122122
// 闰月
123-
if (leap > 0 && i == leap + 1 && isLeap == false) {
123+
if (leap > 0 && i === leap + 1 && isLeap === false) {
124124
--i;
125125
isLeap = true;
126126
temp = leapDays(years);
127127
} else {
128128
temp = monthDays(years, i);
129129
}
130130
// 解除闰月
131-
if (isLeap == true && i == leap + 1) {
131+
if (isLeap === true && i === leap + 1) {
132132
isLeap = false;
133133
}
134134
offset -= temp;
135135
}
136136

137-
if (offset == 0 && leap > 0 && i == leap + 1) {
137+
if (offset === 0 && leap > 0 && i === leap + 1) {
138138
if (isLeap) {
139139
isLeap = false;
140140
} else {
@@ -173,7 +173,7 @@ export function lYearDays(year: number) {
173173
*/
174174
export function leapDays(year: number) {
175175
if (leapMonth(year)) {
176-
return (lunarInfo[year - 1899] & 0xf) == 0xf ? 30 : 29;
176+
return (lunarInfo[year - 1899] & 0xf) === 0xf ? 30 : 29;
177177
} else {
178178
return 0;
179179
}
@@ -184,14 +184,14 @@ export function leapDays(year: number) {
184184
*/
185185
export function leapMonth(year: number) {
186186
let lm = lunarInfo[year - 1900] & 0xf;
187-
return lm == 0xf ? 0 : lm;
187+
return lm === 0xf ? 0 : lm;
188188
}
189189

190190
/**
191191
*返回农历y年m月的总天数
192192
*/
193193
export function monthDays(year: number, month: number) {
194-
return lunarInfo[year - 1900] & (0x10000 >> month) ? 30 : 29;
194+
return (lunarInfo[year - 1900] & (0x10000 >> month)) ? 30 : 29;
195195
}
196196

197197
/**

packages/core/src/Calendar/show.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React, { useEffect, useState } from 'react';
2-
import { View, Text, ViewProps, TextProps, StyleSheet, TouchableOpacity } from 'react-native';
3-
import Icon from '../Icon';
1+
import React from 'react';
2+
import { View, Text, ViewProps, StyleSheet } from 'react-native';
3+
// import Icon from '../Icon';
44

55
export interface ShowProps extends ViewProps {
66
iconColor?: string;
77
lunar?: string;
88
}
99
const Show = (props: ShowProps) => {
10-
const { iconColor = '#329BCB', lunar = '' } = props;
10+
const { lunar = '' } = props;
1111
return (
1212
<View style={styles.show}>
1313
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>{lunar}</Text>

packages/core/src/Calendar/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function getMonths(year: number, month: number, day: number) {
3030
* 判断年闰年
3131
*/
3232
export function isLeapYear(year: number) {
33-
return year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);
33+
return (year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0));
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)