• Resolved kingkante90

    (@kingkante90)


    I need to make a due date pregnancy calculator.

    The user would select the date of their last period (d/m/y) as well as their average menstrual cycle length (in days – from 28 days to 40). Currently the default option only has the date of their last period.

    To work out the estimate due date it is then the first date of the last period, plus 9 months, plus average cycle length, minus 21 days.

    I can’t get my head around how to do this, have been trying for hours and failing miserably! Any help would be massively appreciated!

    • This topic was modified 7 years, 5 months ago by kingkante90.
Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    If the date for the last period is the fieldname1, and the average menstrual cycle length is the fieldname2, the equation for the due date (as you describe it) would be simply:

    cdate(fieldname1+40*7+fieldname2-21)

    and that’s all.

    If you need additional help with your project, I can offer you a custom coding service from my personal website:

    https://cff.dwbooster.com/customization

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Pregnancy Calculator’ is closed to new replies.