Skip to content

Rebalance a range to target proportions

How-to guide

mp balance rewrites the working days of a range so the given projects hold the requested shares of the range’s target hours. Every day ends up exactly at its target; any other project’s hours on those days are cleared. Shares must add up to 100.

Two layouts:

  • whole-days (default): consecutive whole days per project, X first then Y; only the day where a quota ends is split.
  • every-day: every single day is split by the shares (4.8 h / 3.2 h for 60/40, rounded to quarter hours so that the totals stay exact).

For the first two weeks of September I want 60% NovaLabs and 40% administration. Show me the plan.

mp_balance {year: 2026, month: 9, range: {from: "2026-09-01", to: "2026-09-12"}, slots: [{project: {order: "900140", attendanceType: "0081"}, share: 60}, {project: {attendanceType: "0077"}, share: 40}], dryRun: true}

returns the per-day plan. Add mode: "every-day" to split each day instead. Without dryRun it writes and returns the resulting mp_stats.