Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Lockdown period documentation seems not to align with implementation code #376

Open
sharky98 opened this issue Jan 26, 2024 · 1 comment

Comments

@sharky98
Copy link
Contributor

When looking through the docs for the translation, I was wondering how the lockdown period worked. The docs seems to not be aligned with how src/Timesheet/LockdownService.php is working in few points.

Relative to now

It seems that the lockdown period are not checked against now for neither start or end, but are used (almost) as-is to create a new DateTimeImmutable.

While I understand that PHP will check the relative string to now with string like -2 weeks, it won't do it if provided a more "fixed" relative string such as last day of next month1.

I would suggest removing reference to relative to now in the docs (and translations to start, end) to avoid confusion.

Grace Relative to lockdown end period

Here, the docs seems to tell us that the relative date string will be used against the end of the lockdown period, but could be modified with the of modifier. However this seems partly true when looking at the code. It seems that the grace period is used to modify the lockdown end period. So, if I understand the code correctly, if the grace period is +2 weeks, it works as expected (2 weeks after the lockdown end period). However, if the grace period is last day of next month and this is applied on the lockdown end period, this would mean that the grace period would be extended more than expected2.

Activating the lockdown

The docs tell us the lockdown will be active if all three fields are populated. But the code seems to check only for start and end, not grace.

Footnotes

  1. OK, it still uses now to be relative to. However this is not within an arithmetic calculation. And the user could provide a fixed month and year such as last sat of July 2008 (but why?!).

  2. Like if the lockdown is set to last day of next month and grace to last day of next month, relative to today (2024-01-26), the lockdown will end on 2024-02-29 but the grace period will be set to 2024-03-31, while the docs seems to tell us that using of will bring it to relative to today.

@sharky98
Copy link
Contributor Author

sharky98 commented Jan 26, 2024

I have created different pull request to accept to your liking (or not). And also provided source string suggestion to the translation.

sharky98 added a commit to sharky98/www.kimai.org that referenced this issue Jan 26, 2024
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

No branches or pull requests

1 participant