04/29 Updated Time attendance export by building time frame
This commit is contained in:
@@ -137,10 +137,15 @@ def _resolve_date_range(start_date_filter, end_date_filter, records, export_labe
|
||||
)
|
||||
end_date = capped_end_date
|
||||
|
||||
# Preserve one extra calendar day so early-morning check-out records
|
||||
# stored on Day N+1 remain available for overnight pairing detection.
|
||||
# Display range is still controlled by dates_with_records (capped to end_date).
|
||||
filtered_records = [r for r in records if r.attendance_date <= end_date + timedelta(days=1)]
|
||||
# Apply both bounds:
|
||||
# - Lower bound: exclude records before start_date (prevents historical data leaking in).
|
||||
# - Upper bound (+1 day buffer): early-morning check-out records stored on Day N+1
|
||||
# must remain available for overnight pairing detection; the display range is
|
||||
# still controlled by each export's sorted_dates (capped to end_date).
|
||||
filtered_records = [
|
||||
r for r in records
|
||||
if start_date <= r.attendance_date <= end_date + timedelta(days=1)
|
||||
]
|
||||
|
||||
return start_date, end_date, filtered_records
|
||||
|
||||
|
||||
Reference in New Issue
Block a user