Skip to content

Feat; Add KOITO_DATE_FORMAT, KOITO_CLOCK_FORMAT and KOITO_WEEK_START configuration options#300

Open
joffrey-b wants to merge 2 commits into
gabehf:mainfrom
joffrey-b:add-date-clock-format
Open

Feat; Add KOITO_DATE_FORMAT, KOITO_CLOCK_FORMAT and KOITO_WEEK_START configuration options#300
joffrey-b wants to merge 2 commits into
gabehf:mainfrom
joffrey-b:add-date-clock-format

Conversation

@joffrey-b
Copy link
Copy Markdown
Contributor

@joffrey-b joffrey-b commented May 30, 2026

Description

The current behavior of dates and clock formats, as well as for the first day of the week is to follow the browser's locale. These three configuration options allow users to choose how the date and clock values are displayed, and which day is the starting day of the week in the activity grids.

Related Issue(s)

Closes #152 for the date, clock and start of the week have no opened issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Unit Tests
  • Manual Testing (please describe steps)
  1. Set a correct date format and recreate the container
  2. Go to the web UI and check all activity grids, listening since, tooltips, last played timestamps older than a day
  3. All show the correct date format
  4. Unset the variable : it defaults to browser locale. I've tested with English US and French and it works
  5. Set a correct clock format and restart the container
  6. Check all last played older than a day, listening since tooltips
  7. All show the correct clock format
  8. Unset the variable : it defaults to browser locale. I've tested again with English US and French and it works
  9. Setting only one of the two variables, or both, works fine
  10. Set an invalid date format (like DD+MM/YYYY or DD/DD/YYYY) and recreate the container
  11. It doesn't start, and docker logs show : "Engine: failed to load configuration: cfg.Load: loadConfig: KOITO_DATE_FORMAT must use DD, MM, and YYYY tokens with a single / - or . separator (e.g. DD/MM/YYYY)"
  12. Set an invalid clock format (like 14h) and recreate the container
  13. It doesn't start, and docker logs show : "Engine: failed to load configuration: cfg.Load: loadConfig: KOITO_CLOCK_FORMAT must be either '12h' or '24h'"
  14. The last listened newer than a day still show "X hours ago"
  15. Set a correct day in the KOITO_WEEK_START variable and restart the container
  16. Check all activity grids : the first day of the week follows what's put in the variable (I tested all days)
  17. Unset the variable : it defaults to the browser locale (except for firefox which is always Monday)
  18. Put a wrong value in the variable and restart the container
  19. It doesn't start, and docker logs show : "Engine: failed to load configuration: cfg.Load: loadConfig: KOITO_WEEK_START must be one of: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday"

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have ensured my changes generate no new warnings

AI/LLM Usage

  • I disclose that 100% of the code in this PR is written by an LLM. (please estimate)
  • I fully understand all changes made by LLM-generated code.
  • I have not and will not use an LLM to write any part of this PR description or PR comments.

Screenshots (if applicable)

image image image image

Comment thread client/app/components/ActivityGrid.tsx Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should also be configurable via env? In my mind, the first day of the week is a part of date-time settings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're right. I pushed a commit that implements this, and edited the PR title and body with the new info and the tests I made.
If you want to test go on !

@joffrey-b joffrey-b changed the title Feat; Add KOITO_DATE_FORMAT and KOITO_CLOCK_FORMAT configuration options Feat; Add KOITO_DATE_FORMAT, KOITO_CLOCK_FORMAT and KOITO_WEEK_START configuration options Jun 5, 2026
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.

[Enhancement] Ability to change date format

2 participants