Past date ranges seem to be reversed #2343

Open
opened 2024-06-02 17:13:45 +00:00 by andreymal · 2 comments
Contributor

Description

There's my understanding of date ranges:

  • today: 2024-06-02
  • this week: 2024-05-27 .. 2024-06-02 (assuming Monday is the first day of the week)
  • beginning of this week: 2024-05-27
  • end of this week: 2024-06-02
  • last week: 2024-05-20 .. 2024-05-26
  • beginning of last week: 2024-05-20
  • end of last week: 2024-05-26

However, the actual date ranges seem to be reversed:

  • 'beginningOflastWeek': 'now/w-1w' — 2024-05-20 (ok)

  • 'endOfLastWeek': 'now/w-2w' — 2024-05-13 (?????)

  • 'lastWeek': ['now/w-1w', 'now/w-2w'] — 2024-05-20 .. 2024-05-13 (????????????)

Same with months.

Is this a bug, or am I missing something?

Vikunja Version

any

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

### Description There's my understanding of date ranges: * today: 2024-06-02 * this week: 2024-05-27 .. 2024-06-02 (assuming Monday is the first day of the week) * beginning of this week: 2024-05-27 * end of this week: 2024-06-02 * last week: 2024-05-20 .. 2024-05-26 * beginning of last week: 2024-05-20 * end of last week: 2024-05-26 However, [the actual date ranges](https://kolaente.dev/vikunja/vikunja/src/commit/aac01c7a35836421c17882b4f77334fc14bfeaec/frontend/src/components/date/dateRanges.ts) seem to be reversed: * `'beginningOflastWeek': 'now/w-1w'` — 2024-05-20 (ok) * `'endOfLastWeek': 'now/w-2w'` — 2024-05-13 (?????) * `'lastWeek': ['now/w-1w', 'now/w-2w']` — 2024-05-20 .. 2024-05-13 (????????????) Same with months. Is this a bug, or am I missing something? ### Vikunja Version any ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
andreymal added the
kind/bug
label 2024-06-02 17:13:45 +00:00
andreymal changed title from Past date ranges seem to be inverted to Past date ranges seem to be reversed 2024-06-02 17:15:25 +00:00
Owner

This looks like a bug.

endOfLastWeek should be something like now/w-1w-1d (start of this week, minus one week, minus one day). If this should be "friday of last week" as in, end of the work week, this would be different still.

lastWeek seems to be off by one week and one day.

This looks like a bug. `endOfLastWeek` should be something like `now/w-1w-1d` (start of this week, minus one week, minus one day). If this should be "friday of last week" as in, end of the work week, this would be different still. `lastWeek` seems to be off by one week and one day.
frederick added the
moved-to-github
label 2025-04-01 11:08:40 +00:00
Member

As we're moving Vikunja to GitHub, this issue has been migrated to GitHub: https://github.com/go-vikunja/vikunja/issues/566

To learn more about why we're doing this, please check out the announcement.

As we're moving Vikunja to GitHub, this issue has been migrated to GitHub: https://github.com/go-vikunja/vikunja/issues/566 To learn more about why we're doing this, please check out the [announcement](https://vikunja.io/changelog/moving-to-github/).
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikunja/vikunja#2343
No description provided.