Skip to content

[UPDT] ATTENDANCE: Monthly summary decides in one place whether a day has happened - #1437

Open
adamsthws wants to merge 1 commit into
horilla:dev/v2.0from
LBS-Sheet-Metal:refactor/summary-day-has-happened
Open

adamsthws wants to merge 1 commit into
horilla:dev/v2.0from
LBS-Sheet-Metal:refactor/summary-day-has-happened

Conversation

@adamsthws

Copy link
Copy Markdown
Contributor

Problem

The Monthly Attendance Summary's table, calendar and day-wise view each compare dates with today on their own (d > today, d <= datetime.date.today(), …), and a day after today becomes Upcoming only when nothing is on it (Absent). Whatever else a day still to come has so far is drawn and counted as if the day were over.

Change

  • One helper, day_has_happened(day), decides it everywhere.
  • A day still to come is Upcoming whatever is on it so far: no overtime badge or conflict ring, and nothing counted. Leave, holidays and week offs dated ahead keep their colour, as now.
  • Today has happened, so nothing changes in practice.
  • A deployment that prefers to judge a day only once it's over (today shown as Upcoming until tomorrow) can say so in one place.

Tests

attendance/tests/test_day_has_happened.py (3 tests): today and before have happened; a past day shows what was worked; a day still to come (the helper patched) is Upcoming in the calendar and the day-wise view, counted as upcoming in the calendar and the table, and not as present.

Checklist

  • This PR targets dev/v2.0, not 2.0.
  • I've followed the coding conventions in CONTRIBUTING.md (Black + isort via the repo's pre-commit)
  • CI (Docker CI + Quality) passes
  • I've linked any related issues

Related issues

None.

… has happened

The table, the calendar and the day-wise view each compared dates with today
on their own, and only turned a day after today with nothing on it into
Upcoming. One helper, day_has_happened, now decides it everywhere, and a day
still to come is Upcoming whatever is on it so far (leave, holidays and week
offs dated ahead keep their colour), with no overtime badge or conflict and
nothing counted. Today has happened, so nothing changes; a deployment that
waits for a day to close before judging it can say so in one place. With tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant