feat: Integrate date in task bar

- Date format can now be changed dynamically
- Date element is now created in task bar class
- Class can accept options, currently only for date
- Date format is changed according to position
- Changed dom structure for clock
- Refactor setPosition method to be more flexible
- Changed flex style for task bar items to inherit the direction
This commit is contained in:
sthag 2025-11-02 09:26:19 +01:00
parent abf393191c
commit 20b43b8d35
4 changed files with 117 additions and 53 deletions

View file

@ -296,6 +296,12 @@ class DateDisplay {
this.element.textContent = this.formatDate(now);
}
changeFormat(format) {
this.options = format;
this.updateDate();
}
getTimeUntilNextMidnight() {
const now = new Date();
const nextMidnight = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);