|
|
@@ -1,6 +1,6 @@
|
|
|
import datetime
|
|
|
|
|
|
-from chinese_calendar import is_holiday
|
|
|
+from chinese_calendar import is_workday
|
|
|
|
|
|
## 考勤范围:在指定时间区间内,随机时间进行考勤
|
|
|
# 考勤范围开始,格式 [小时, 分钟]
|
|
|
@@ -13,9 +13,11 @@ END_TIME = [10, 0]
|
|
|
# 自定义规则(此处设置周六周日不打卡,1月后不打卡)
|
|
|
def check_rule():
|
|
|
t = datetime.date.today()
|
|
|
- if t.weekday() == 5 or t.weekday() == 6 or is_holiday(t): # 周六日无需打卡
|
|
|
+ #if t.weekday() == 5 or t.weekday() == 6 or is_holiday(t): # 周六日无需打卡
|
|
|
+ # return False
|
|
|
+ if not is_workday(t):
|
|
|
return False
|
|
|
-
|
|
|
+
|
|
|
if t.month > 6: # 6月后无需打卡
|
|
|
return False
|
|
|
|