-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the feature you'd like
This is not a new user-facing feature.
The DateFormatter currently has limited test coverage, which makes it
harder to confidently refactor or adjust timezone-related logic.
Adding coverage for edge cases (leap years, DST transitions, timezone
extremes) would improve long-term stability and reduce the risk of
regressions.
Describe the benefits this would bring to existing BookStack users
Although this change only adds tests and doesn’t alter any user-facing behavior, it brings several indirect but important benefits to BookStack users:
-
More reliable dates and times
Users across different timezones, especially those affected by daylight-saving changes, are less likely to see incorrect or confusing timestamps. -
Fewer regressions in future updates
Date and timezone logic is easy to break unintentionally. These tests act as a safety net, reducing the risk that future changes introduce subtle bugs that only affect certain regions or dates. -
Better experience for international teams
BookStack is widely used by global teams. Ensuring consistent behavior across timezones, leap years, and locale boundaries helps keep collaboration smooth and predictable. -
Safer upgrades
Stronger test coverage allows maintainers to refactor or optimize date-handling code with more confidence, leading to more stable releases over time. -
Improved long-term stability
Edge cases (such as DST transitions or leap years) often cause rare but frustrating bugs. Catching these early helps prevent hard-to-reproduce issues that impact trust in the system.
In short, this improves the robustness and reliability of BookStack’s date handling, helping ensure users see accurate and consistent information regardless of location or time of year.
Can the goal of this request already be achieved via other means?
Partially, yes.
BookStack already relies on Carbon and PHP’s timezone handling, which are well-tested and handle most common date and timezone scenarios correctly. The existing DateFormatter` tests also cover basic expected behavior.
However, these mechanisms don’t explicitly protect against BookStack-specific regressions in edge cases such as leap years, DST transitions, or large timezone offsets. Those issues often only surface under specific conditions and are easy to miss during refactors or internal changes.
The goal of this request isn’t to replace existing safeguards, but to add an additional layer of protection by explicitly testing known edge cases in BookStack’s own formatting logic. This makes failures easier to detect early and increases confidence when making future changes.
Have you searched for an existing open/closed issue?
- I have searched for existing issues and none cover my fundamental request
How long have you been using BookStack?
Under 3 months