[PR #1058] [MERGED] Goals: Add timezone offset to date calculations #3492

Closed
opened 2026-02-28 20:42:26 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1058
Author: @shall0pass
Created: 5/24/2023
Status: Merged
Merged: 5/24/2023
Merged by: @j-f1

Base: masterHead: goalsDateOffset


📝 Commits (9)

📊 Changes

2 files changed (+27 additions, -15 deletions)

View changed files

📝 packages/loot-core/src/server/budget/goaltemplates.ts (+21 -15)
upcoming-release-notes/1058.md (+6 -0)

📄 Description

This PR adds the timezone offset to the date anytime a new date is created. If you use 'by' or 'schedule' keywords that rely on the date the calculation could change based on which time zone the computer is using.

For example: I live in UTC-05:00. If I create a 'by' template using 2023-06 as the completion date, the actual date returned is 2023-05-31 19:00:00. Likewise, if the time zone is UTC+05:00 the returned date would be 2023-06-01 05:00. Because the first of the month is used, this can result in an error of 1 month depending on the computers clock.

By adding the time zone offset to the returned date when a date is created, it set's the date to 00:00 for the desired date and eliminates inconsistencies when users are in different time zones.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/1058 **Author:** [@shall0pass](https://github.com/shall0pass) **Created:** 5/24/2023 **Status:** ✅ Merged **Merged:** 5/24/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `goalsDateOffset` --- ### 📝 Commits (9) - [`71ff383`](https://github.com/actualbudget/actual/commit/71ff383d9394f05d926130eb1f366c68e303faf6) timezone changes - [`4efa4e8`](https://github.com/actualbudget/actual/commit/4efa4e8d9984a94ecc5f545acdc991285e156b70) Merge branch 'actualbudget:master' into goalsDateOffset - [`934a1a1`](https://github.com/actualbudget/actual/commit/934a1a138d68f061166dfdb09e332dfd531b3e02) lint - [`adc1ff4`](https://github.com/actualbudget/actual/commit/adc1ff4e3a356d7cc1532cf592273c6c49f336a9) Found in PR 1049 - [`4048caa`](https://github.com/actualbudget/actual/commit/4048caa6d9099f6afc523d31d21c78645d4abeff) remove comment - [`68347db`](https://github.com/actualbudget/actual/commit/68347dbed41d9067b6061e84ffb849bf12901157) release notes - [`cd18c9f`](https://github.com/actualbudget/actual/commit/cd18c9f4066e2538af7e0850ca50569b12b37ee7) Merge branch 'master' into goalsDateOffset - [`b29f48d`](https://github.com/actualbudget/actual/commit/b29f48d6d03cad5ad35c8c2e54438c44dae13529) feedback changes - [`981e529`](https://github.com/actualbudget/actual/commit/981e529680038b769c08d5e0d04534d1fa056763) formatting ### 📊 Changes **2 files changed** (+27 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/budget/goaltemplates.ts` (+21 -15) ➕ `upcoming-release-notes/1058.md` (+6 -0) </details> ### 📄 Description This PR adds the timezone offset to the date anytime a new date is created. If you use 'by' or 'schedule' keywords that rely on the date the calculation could change based on which time zone the computer is using. For example: I live in UTC-05:00. If I create a 'by' template using 2023-06 as the completion date, the actual date returned is 2023-05-31 19:00:00. Likewise, if the time zone is UTC+05:00 the returned date would be 2023-06-01 05:00. Because the first of the month is used, this can result in an error of 1 month depending on the computers clock. By adding the time zone offset to the returned date when a date is created, it set's the date to 00:00 for the desired date and eliminates inconsistencies when users are in different time zones. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:42:26 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#3492