|
|
@@ -265,14 +265,21 @@ class PunchClocks extends Component {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if ([5, 6].indexOf(dtails.type) === -1 && (dayjs().isBefore(dtails.releaseStarts) || dayjs().isAfter(dtails.releaseEnds))) {
|
|
|
- Taro.hideLoading()
|
|
|
- Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
- return;
|
|
|
- } else if (dayjs().isAfter(dayjs(dtails.releaseEnds).add(1, 'day'))) {
|
|
|
- Taro.hideLoading()
|
|
|
- Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
- return;
|
|
|
+ if ([5, 6].includes(dtails.type)) {
|
|
|
+ let nowTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ let startTime = dayjs(dtails.releaseStarts).format('YYYY-MM-DD 00:00:00')
|
|
|
+ let endTime = dayjs(dtails.releaseEnds).format('YYYY-MM-DD 23:59:59')
|
|
|
+ if (dayjs(nowTime).isAfter(dayjs(startTime)) && dayjs(nowTime).isBefore(dayjs(endTime)) ) {
|
|
|
+ Taro.hideLoading()
|
|
|
+ Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ((dayjs().isBefore(dtails.releaseStarts) || dayjs().isAfter(dtails.releaseEnds))) {
|
|
|
+ Taro.hideLoading()
|
|
|
+ Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|