Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

calculating age in weeks and days

Community Beginner ,
Nov 26, 2019 Nov 26, 2019

Help please 

if I need to calculate the gestational age in a certain date (any date)

how do I do please ?

  

I have 2 feilds 

the first "DG" date of conception

the second "age" the date at which i want to calcule the gestational age in weeks and days 

this my script (try67 helped me in this script) but this script is for the today date :

var dateFormat = "dd/mm/yyyy"; var startDateString = this.getField("DG").valueAsString; event.value = ""; if (startDateString!="") { var startDate = util.scand(dateFormat, startDateString); if (startDate!=null) { var now = new Date(); var dayInMs = 86400000; var diff = Math.round((now.getTime()-startDate.getTime())/dayInMs); var diffInWeeks = Math.floor(diff/7); var diffInDays = diff-(diffInWeeks*7); event.value = diffInWeeks + " SA " + diffInDays + " jours"; } }

please help me

TOPICS
Acrobat SDK and JavaScript
424
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2019 Nov 26, 2019
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines