主页 > 孕期工具 >

排卵期和安全期计算器

来源:福州台江医院 阅读量:次
最短月经周期
最长月经周期
上次月经时间
测试结果
var CalendarOuterHTML = ''; var Today = new Date(); var DaysPerMonth = 0; //Get the number of day in some month function GetDayPerMonth(year,month) { var monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29; DaysPerMonth = monthDays[month]; } function GetCalendarOuterHTML(CalendarIndex,HaveLayer) { CalendarOuterHTML = ''; var thisYear = document.frmInput.txtYear.value; var thisMonth = parseInt(document.frmInput.txtMonth.value) + CalendarIndex - 1 ; //when thisMonth beyond 12 if (thisMonth > 12) { thisYear = parseInt(thisYear) + 1; thisMonth = thisMonth % 12; } //title of the calendar CalendarOuterHTML = CalendarOuterHTML + ""; CalendarOuterHTML = CalendarOuterHTML + ""; //Get the day of the first Day var firstDay = new Date(Date.UTC(document.frmInput.txtYear.value,(parseInt(document.frmInput.txtMonth.value)-2+CalendarIndex),1)); testMe = firstDay.getDate(); if (testMe == 2) firstDay.setDate(0); startDay = firstDay.getDay(); //display empty cells before the first day of the month column = 0; for (i=0; i"; column++; } //display the grids in the calendar var Lastday = new Date(Date.UTC(document.frmInput.txtYear.value,(parseInt(document.frmInput.txtMonth.value)-1),document.frmInput.txtDay.value)) GetDayPerMonth(thisYear,thisMonth-1) for (i=1; i<=DaysPerMonth; i++) { CalendarOuterHTML = CalendarOuterHTML + ""; column = 0; } } //display empty cells after the final day of the month var FinalDay = new Date(Date.UTC(document.frmInput.txtYear.value,(parseInt(document.frmInput.txtMonth.value)-2+CalendarIndex),DaysPerMonth)); testMe = FinalDay.getDate(); if (testMe == 2) FinalDay.setDate(0); EndDay = FinalDay.getDay(); for (i=EndDay; i<6; i++) { CalendarOuterHTML = CalendarOuterHTML + "
"; CalendarOuterHTML = CalendarOuterHTML + thisYear+' 年 '; CalendarOuterHTML = CalendarOuterHTML + thisMonth +' 月'; CalendarOuterHTML = CalendarOuterHTML + "
六"; CalendarOuterHTML = CalendarOuterHTML + "
"; var color = "blue"; //default color without layer displayed //Get layer HTML if (HaveLayer) { var ThisDay = new Date(Date.UTC(thisYear,thisMonth-1,i)) var msPerDay = 24 * 60 * 60 * 1000 ; var mensesCyc = parseInt(document.frmInput.txtMinMensesCyc.value); //Min menses Cycle var msDiff = ThisDay.getTime() - Lastday.getTime(); dayDiff = Math.floor(msDiff / msPerDay); //get the days between thisday and lastday dayRemainder = (dayDiff % mensesCyc + mensesCyc) % mensesCyc; //if (i<2) {alert(ThisDay.toLocaleString()); alert(Lastday.toLocaleString()); alert(dayDiff);alert(dayRemainder);} var tooltips =""; //content of layer if (dayRemainder>=0 && dayRemainder<=4) { color = "#FF9900"; tooltips = "这是月经期,要注意经期卫生,当然也要'节欲',避免性事哦!" } if (dayRemainder>=5 && dayRemainder<=(mensesCyc-20)) { color = "#009933"; tooltips = "这是安全期,性事一般不会受孕,您放心吧!"; } if (dayRemainder>=(mensesCyc-19) && dayRemainder<=(mensesCyc-10)) { color = "#FF3300"; tooltips = "这是危险期,亦称排卵期,性事受孕可能性大,千万要注意哦!"; } if (dayRemainder>=(mensesCyc-9) && dayRemainder<=(mensesCyc-1)) { color = "#009933"; tooltips = "这是安全期,性事一般不会受孕,您放心吧!"; } iLayerIndex = 40*CalendarIndex + i ; //index of layer } CalendarOuterHTML = CalendarOuterHTML + "" + i + ""; column++; if (column == 7) { CalendarOuterHTML = CalendarOuterHTML + "
"; } CalendarOuterHTML = CalendarOuterHTML + "
"; } //to check input errors and display both calendars function DisplayCalendar() { //check whether the date is legal if (document.frmInput.txtYear.value<1900||isNaN(document.frmInput.txtYear.value)) { alert("请输入合法年份!") document.frmInput.txtYear.focus(); return false; } if (isNaN(document.frmInput.txtMonth.value) || document.frmInput.txtMonth.value<1 || document.frmInput.txtMonth.value>12) { alert("请输入合法月份!") document.frmInput.txtMonth.focus(); return false; } GetDayPerMonth(document.frmInput.txtYear.value,document.frmInput.txtMonth.value-1) if (isNaN(document.frmInput.txtDay.value) || document.frmInput.txtDay.value<1 || document.frmInput.txtDay.value>DaysPerMonth) { alert("请输入合法日期!") document.frmInput.txtDay.focus(); return false; } var Lastday = new Date(Date.UTC(document.frmInput.txtYear.value,(parseInt(document.frmInput.txtMonth.value)-1),document.frmInput.txtDay.value)) if ((Today.getTime() - Lastday.getTime())<0) { alert("请输入正确的上次月经时间(不能早于当前时间)!") document.frmInput.txtYear.focus(); return false; } //check input if(isNaN(document.frmInput.txtMinMensesCyc.value)) { alert("请输入数字!") document.frmInput.txtMinMensesCyc.focus(); return false; } if(parseInt(document.frmInput.txtMinMensesCyc.value)>40 || parseInt(document.frmInput.txtMinMensesCyc.value)<22 ) { alert("您输入的最短月经周期与标准月经周期相差太大,程序无法测试,请仔细核对。\n\n如输入确无问题请咨询医生!") document.frmInput.txtMinMensesCyc.focus(); return false; } if(isNaN(document.frmInput.txtMaxMensesCyc.value) || parseInt(document.frmInput.txtMaxMensesCyc.value)
安全期计算原理
女性的排卵日期一般在下次月经来潮前的14天左右。下次月经来潮的第1天算起,倒数14天或减去14天就是 排卵日,排卵日及其前5天和后4天加在一起称为排卵期。例如,某女的月经周期为28天,本次月经来潮的第1天在12月2日,那么下次月经来潮是在12月 30日(12月2日加28天),再从12月30日减去14天,则12月16日就是排卵日。排卵日及其前5天和后4天,也就是12月11-20日为排卵期。 除了月经期和排卵期,其余的时间均为安全期。在安全期性交可不必采用任何避孕药物和避孕工具。 安全期月历因个人体质变异差异极大,因此仅供参考。 欲避孕者,请採取安全之避孕方式; 欲怀孕者,也还请多多努力...
免费自助挂号平台咨询专家
var myDate = new Date(); var yyDay = myDate.getDate(); var yyMonth = myDate.getMonth() + 1; var yyHours = myDate.getHours(); window.onload=function(){ oMonth = document.getElementById("month"); for(i=0;i
(本网站已加密,绝对保护个人隐私)
您的姓名:
您的电话: *
您的QQ: *
预约时间:
您的问题:

节假日不休 8:00-17:00(开诊)

医院地址:
福州市五一南路293号