Skip to content

Conversation

code-with-jov
Copy link

Pitch:
The biggest challenge with any budget is knowing you’ll have the right amount of money at the right time. Actual Budget’s envelop method does a great job of tracking this by encouraging you to plan only with the money you currently have.

A Pay Period view would allow for planning in income driven slices. Instead of an arbitrary month, a user could select whether they get paid weekly, bi-weekly, etc. and there budget view would be broken down in that time range (e.g Aug 29th - Sep 12th). This allows for planning with numbers proportional to and with the time reference of your income.

Additionally, a Pay Period view solves the Tracking Budget’s biggest issue. Since the time slices are income driven, you can be more confident you’ll have the right amount of money when you need it.

Technical Description:
This approach emphasizes backwards compatibility by adding additional "months" to YYYYMM. 1 - 12 remain Calendar Months, while 13 - 99 are leveraged for Pay Periods. It is calculation heavy, as it uses the Frequency and Start Date configurations set on the settings page (only visible after enabling the experimental feature) to derive date ranges. A "Show Pay Periods" checkbox is displayed at the top of the budget page - allowing users to quickly toggle between Month and Pay Period views.

This is still very much a work in progress. I need to ensure Spent values display for Pay Periods, that a Pay Period can do everything a Month can do (e.g. Roll Over, handle templates, etc.), and then do a clean up to make sure pay period logic is isolated as much as possible.

Completed Functionality:

Experimental Feature Flag:
image

Pay Period Configs:
image

  • This Supports Monthly, Bi-Weekly, and Weekly

Toggleable Pay Periods vs Month view
image

  • MonthPicker shows the Month and the count of how many pay periods are in that month. In this example Aug shows 3 because the pay period started on Aug 29th. September does not include that in its count

code-with-jov and others added 20 commits September 5, 2025 22:50
Extract pay period related functions into a new `pay-periods.ts` module.

Co-authored-by: ashleyriverapr <[email protected]>
This commit integrates pay period functionality into the month utilities, allowing for the handling of months 13-99 as pay periods. Key updates include:

- Enhanced month validation to distinguish between calendar months and pay periods.
- Updated arithmetic functions (add, subtract, next, previous) to accommodate pay periods.
- New utility functions for generating pay periods and handling date conversions.
- Comprehensive tests to ensure correct identification and manipulation of pay periods.

Backward compatibility with existing calendar month functionality is maintained, ensuring a seamless transition for users.
…-phase-1-1-4cb7

Implement pay period phase 1.1
…rience

- Removed redundant "Enable Pay Periods" checkbox and "Show pay periods in budget view" option, simplifying the settings interface.
- Updated Pay Period Settings UI to focus on frequency and start date only.
- Streamlined control flow to a two-layer system (feature flag + view toggle) for better clarity and usability.
- Eliminated year start constraints, allowing pay periods to function seamlessly across any year.
- Enhanced budget components to reflect these changes, ensuring consistent behavior and improved performance.

This refactor aims to enhance user experience by reducing complexity and ensuring intuitive interactions with pay period features.
…pay-periods-implementation-6547

Review and complete pay periods implementation
…-phases-1-2-and-1-3-b06c

Implement pay period phases 1.2 and 1.3
…uration, generation, and utility functions, to streamline the project and eliminate unused code.
- Updated MonthPicker to use new monthUtils.getMonthDisplayName for improved PayPeriod formatting.
- Refactored BudgetSummary components in both tracking and envelope contexts to utilize monthUtils.getMonthDateRange for consistent date range display.
- Modified BudgetPage to reflect the new PayPeriod/Month display logic.
- Enhanced month utility functions to support better pay period handling and display.
Copy link

netlify bot commented Sep 15, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 73a038f
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/68c81db4bc809a0008a97d57
😎 Deploy Preview https://deploy-preview-5730.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
23 10.78 MB → 10.8 MB (+19.42 kB) +0.18%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/pay-periods.ts 🆕 +7.73 kB 0 B → 7.73 kB
src/components/settings/PayPeriodSettings.tsx 🆕 +1.73 kB 0 B → 1.73 kB
node_modules/date-fns/isWithinInterval.js 🆕 +1.3 kB 0 B → 1.3 kB
node_modules/date-fns/endOfYear.js 🆕 +1.06 kB 0 B → 1.06 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/date-utils.ts 🆕 +633 B 0 B → 633 B
src/components/budget/BudgetPageHeader.tsx 📈 +996 B (+103.11%) 966 B → 1.92 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/months.ts 📈 +4.12 kB (+50.71%) 8.13 kB → 12.26 kB
src/components/budget/index.tsx 📈 +1.25 kB (+13.89%) 8.98 kB → 10.23 kB
src/hooks/useFeatureFlag.ts 📈 +28 B (+8.48%) 330 B → 358 B
src/components/settings/Experimental.tsx 📈 +228 B (+5.30%) 4.2 kB → 4.43 kB
src/components/budget/MonthPicker.tsx 📈 +172 B (+2.50%) 6.71 kB → 6.88 kB
src/components/settings/index.tsx 📈 +160 B (+1.75%) 8.93 kB → 9.09 kB
src/components/budget/tracking/budgetsummary/BudgetSummary.tsx 📈 +23 B (+0.28%) 8.12 kB → 8.14 kB
src/components/budget/envelope/budgetsummary/BudgetSummary.tsx 📈 +23 B (+0.25%) 9.14 kB → 9.16 kB
src/components/mobile/budget/BudgetPage.tsx 📈 +19 B (+0.07%) 25.59 kB → 25.61 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 7.84 MB → 7.86 MB (+18.15 kB) +0.23%
static/js/wide.js 116.88 kB → 118.13 kB (+1.25 kB) +1.07%
static/js/narrow.js 451.08 kB → 451.1 kB (+19 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/de.js 144.71 kB 0%
static/js/en-GB.js 6.84 kB 0%
static/js/en.js 130.62 kB 0%
static/js/es.js 72.64 kB 0%
static/js/fr.js 152.06 kB 0%
static/js/it.js 144.76 kB 0%
static/js/nl.js 100.23 kB 0%
static/js/pl.js 86.46 kB 0%
static/js/pt-BR.js 142.44 kB 0%
static/js/sv.js 67.43 kB 0%
static/js/th.js 188.48 kB 0%
static/js/uk.js 188.09 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/ReportRouter.js 830.43 kB 0%
static/js/TransactionList.js 10.92 kB 0%
static/js/useAccountPreviewTransactions.js 8.52 kB 0%
static/js/useTransactionBatchActions.js 10.31 kB 0%

Copy link
Contributor

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 4.29 MB → 4.29 MB (+1.13 kB) +0.03%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/date-utils.ts 🆕 +535 B 0 B → 535 B
home/runner/work/actual/actual/packages/loot-core/src/shared/pay-periods.ts 🆕 +264 B 0 B → 264 B
home/runner/work/actual/actual/packages/loot-core/src/shared/months.ts 📈 +359 B (+8.83%) 3.97 kB → 4.32 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.CghVZF_K.js 0 B → 4.29 MB (+4.29 MB) -

Removed

Asset File Size % Changed
kcab.worker.BV83X5tw.js 4.29 MB → 0 B (-4.29 MB) -100%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

No assets were unchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants