def F_GetDepartureMonthCalendarDays(value_type=1): departure_time = individual_dict['ref_departure_time']
if departure_time: departure_time = departure_time.encode("utf-8") lower_date = "%s01" % departure_time[:8] departure_time = datetime.datetime.strptime(departure_time,'%Y-%m-%d').replace(day=28) + datetime.timedelta(days=4) upper_date = (departure_time-datetime.timedelta(days=departure_time.day)).strftime('%Y-%m-%d') else: return 0 days = F_GetDaysof(lower_date, upper_date, value_type) return days
薪资项:【离职年假折算】中,原来【当月实际工作日】是直接获取的当月工作天数(系统公式直接获取的),现在希望可以获取员工【最后工作日】所在的那个月的工作天数