glanceapp / glanceapp/glance

Unexpected behavior or bug in calendar widget

Open
#293 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
37.1k
Forks
1.5k
Avg merge
1h 11m
Merged PRs (30d)
1

Description

### What's the point
In calendar widget current year defined with standard function `time.ISOWeak()`. And as written in documentation
```golang
// ISOWeek returns the ISO 8601 year and week number in which t occurs.
// Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to
// week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1
// of year n+1.
func (t Time) ISOWeek() (year, week int){}
```
last days of December every year will produce year `n+1` not `n`.

### Thats what i got with date December 30,2024
![image](https://github.com/user-attachments/assets/0158e2cc-5c43-43b3-bd0e-694fa5aa0b70)

Do we need to change `time.ISOWeak()` to `time.Now().Date()` or not?

Also i'm resolving conflicts of PR #174 now, which involves calendar events. And the change to `time.Now().Date()` ensure if someone has events during the New Year's holiday, they will see them in the widget.

Happy New Year 🎉🎉🥳

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.