Count forward forty weeks
The app assumes a regular 28-day cycle and accurate recall of the last period. It computes in whole days on the calendar — leap years and month-ends included — so there's no drift.
A dating scan measures the pregnancy directly and is more accurate than counting from a period. If you have a scan due date, you enter that as the EDD and the whole timeline recomputes from it — scan dating overrides LMP dating.
Worked from the fixed example LMP 2026-01-05.
test/facts.test.js re-derives 2026-10-12 and asserts it.