用户工具

站点工具


在线工具:预产期计算

<HTML> <SCRIPT language=“javascript” type=“text/javascript”> <!– var heihei = new Date(); var countyear = heihei.getYear(); var countmonth = heihei.getMonth(); var countday = heihei.getDate(); function healthtime() { document.health.year.value = countyear; document.health.month.value = countmonth+1; document.health.day.value = countday; } –> </SCRIPT> <SCRIPT language=“javascript” type=“text/javascript”> <!– function haha() { if (document.health.year.value==“” || document.health.month.value==“” || document.health.day.value ==“”) { alert(“请填写完整年月日!”); return false; } if (document.health.year.value>2050 || document.health.year.value<2010) { alert(“请填写正确年份!”); document.health.year.focus(); return false; } if (document.health.month.value>12 || document.health.month.value<1) { alert(“请填写正确月份!”); document.health.month.focus(); return false; } if (document.health.day.value>31 || document.health.day.value<1) { alert(“请填写正确日子!”); document.health.day.focus(); return false; } if (!isDate(document.health.year.value ,document.health.month.value ,document.health.day.value)) { alert(“年月日组合有错,请重新填写!”); return false; } function isDate (year, month, day) { month argument must be in the range 1 - 12 month = month - 1; javascript month range : 0- 11 var tempDate = new Date(year,month,day); if ( (year2k(tempDate.getYear()) == year) && (month == tempDate.getMonth()) && (day == tempDate.getDate()) ) { return true; } else { return false; } } function year2k(d) { return (d < 1000) ? d + 1900 : d; } if (document.health.mweek.value==3) { var stime = document.health.month.value + “/” + document.health.day.value + “/” + document.health.year.value; var stime2 = Date.parse(stime) + 39*7*24*3600*1000; var yuchan2 = new Date(stime2); var yuchan4 = new String(yuchan2); var yuchan3 = yuchan4.split(“ ”); var yuchanmonth = “”; if (yuchan3[1]==“Jan”) yuchanmonth=“1”; if (yuchan3[1]==“Feb”) yuchanmonth=“2”; if (yuchan3[1]==“Mar”) yuchanmonth=“3”; if (yuchan3[1]==“Apr”) yuchanmonth=“4”; if (yuchan3[1]==“May”) yuchanmonth=“5”; if (yuchan3[1]==“Jun”) yuchanmonth=“6”; if (yuchan3[1]==“Jul”) yuchanmonth=“7”; if (yuchan3[1]==“Aug”) yuchanmonth=“8”; if (yuchan3[1]==“Sep”) yuchanmonth=“9”; if (yuchan3[1]==“Oct”) yuchanmonth=“10”; if (yuchan3[1]==“Nov”) yuchanmonth=“11”; if (yuchan3[1]==“Dec”) yuchanmonth=“12”; var yuchan = yuchan3[5] + “-” + yuchanmonth + “-” + yuchan3[2]; var nowt = new Date(); var nowtime = nowt.getTime(); var chatime = nowtime - Date.parse(stime); var chaweek = Math.floor1); if (chaweek<0) chaweek=0; if (chaweek>41) alert(“你的预产期已过!”); document.health.yuchan.value = yuchan; document.health.yuchan2.value = chaweek; return false; } if (document.health.mweek.value==4) { var stime = document.health.month.value + “/” + document.health.day.value + “/” + document.health.year.value; var stime2 = Date.parse(stime) + 40*7*24*3600*1000; var yuchan2 = new Date(stime2); var yuchan4 = new String(yuchan2); var yuchan3 = yuchan4.split(“ ”); var yuchanmonth = “”; if (yuchan3[1]==“Jan”) yuchanmonth=“1”; if (yuchan3[1]==“Feb”) yuchanmonth=“2”; if (yuchan3[1]==“Mar”) yuchanmonth=“3”; if (yuchan3[1]==“Apr”) yuchanmonth=“4”; if (yuchan3[1]==“May”) yuchanmonth=“5”; if (yuchan3[1]==“Jun”) yuchanmonth=“6”; if (yuchan3[1]==“Jul”) yuchanmonth=“7”; if (yuchan3[1]==“Aug”) yuchanmonth=“8”; if (yuchan3[1]==“Sep”) yuchanmonth=“9”; if (yuchan3[1]==“Oct”) yuchanmonth=“10”; if (yuchan3[1]==“Nov”) yuchanmonth=“11”; if (yuchan3[1]==“Dec”) yuchanmonth=“12”; var yuchan = yuchan3[5] + “-” + yuchanmonth + “-” + yuchan3[2]; var nowt = new Date(); var nowtime = nowt.getTime(); var chatime = nowtime - Date.parse(stime); var chaweek = Math.floor2); if (chaweek<0) chaweek=0; if (chaweek>42) alert(“你的预产期已过!”); document.health.yuchan.value = yuchan; document.health.yuchan2.value = chaweek; return false; } if (health.mweek.value==5) { var stime = document.health.month.value + “/” + document.health.day.value + “/” + document.health.year.value; var stime2 = Date.parse(stime) + 41*7*24*3600*1000; var yuchan2 = new Date(stime2); var yuchan4 = new String(yuchan2); var yuchan3 = yuchan4.split(“ ”); var yuchanmonth = “”; if (yuchan3[1]==“Jan”) yuchanmonth=“1”; if (yuchan3[1]==“Feb”) yuchanmonth=“2”; if (yuchan3[1]==“Mar”) yuchanmonth=“3”; if (yuchan3[1]==“Apr”) yuchanmonth=“4”; if (yuchan3[1]==“May”) yuchanmonth=“5”; if (yuchan3[1]==“Jun”) yuchanmonth=“6”; if (yuchan3[1]==“Jul”) yuchanmonth=“7”; if (yuchan3[1]==“Aug”) yuchanmonth=“8”; if (yuchan3[1]==“Sep”) yuchanmonth=“9”; if (yuchan3[1]==“Oct”) yuchanmonth=“10”; if (yuchan3[1]==“Nov”) yuchanmonth=“11”; if (yuchan3[1]==“Dec”) yuchanmonth=“12”; var yuchan = yuchan3[5] + “-” + yuchanmonth + “-” + yuchan3[2]; var nowt = new Date(); var nowtime = nowt.getTime(); var chatime = nowtime - Date.parse(stime); var chaweek = Math.floor3); if (chaweek<0) chaweek=0; if (chaweek>43) alert(“你的预产期已过!”); document.health.yuchan.value = yuchan; document.health.yuchan2.value = chaweek; return false; } } –> </SCRIPT> <STYLE type=“text/css”> <!– body { background:#FFF; margin:0; font:14px Verdana; color:#07519A; } #wrap { width:760px; margin:auto; } table { margin:auto; } td { padding:5px 8px; line-height:20px; } form { width:500px; background:#EDF6FF; border:1px solid #ACE; padding:10px; margin:0 auto; } h3 { margin:0; font:bold 16px/24px Verdana; text-align:center; } –> </STYLE> </HEAD> <BODY> <DIV id=“wrap”>

<FORM name="health" onsubmit="return haha()" method="get">
  <H2>预产期预测 (供参考,请以医院检查为准)</H2>
<TABLE cellspacing="0" cellpadding="0" border="0">
<TBODY><TR>
  <TD valign="top"><TABLE class="top12" height="90" cellspacing="0" cellpadding="0" align="center" border="0">
    <TBODY><TR>
      <TD height="34">您的平均月经周期
        <SELECT name="mweek">
          <OPTION value="3">3</OPTION>
          <OPTION value="4" selected="">4</OPTION>
          <OPTION value="5">5</OPTION>
          </SELECT>
        周</TD>
              </TR>
    <TR>
      <TD height="37">您的末次月经时间
        <INPUT size="6" value="2019" name="year">
        年
        <INPUT size="3" value="0" name="month">
        月
        <INPUT size="3" value="0" name="day">
        日</TD>
              </TR>
    <TR>
      <TD align="center" height="19">
        <INPUT type="button" height="17" width="37" onclick="haha()" value="计算"></TD>
              </TR>
    </TBODY></TABLE></TD>
      </TR>
  <TR>
    <TD background=""><TABLE height="40" cellspacing="0" cellpadding="0" align="center" border="0">
      <TBODY><TR>
        <TD valign="middle">您的预产期是:
          <INPUT readonly="" size="18" name="yuchan">
          <BR>
          您现在正处于孕期的第
          <INPUT readonly="" size="3" name="yuchan2">
          周            </TD>
              </TR>
      </TBODY></TABLE></TD>
      </TR>
  </TBODY></TABLE>
</FORM>

</DIV> <script type='text/javascript'> cpro_client='topy_cpr'; cpro_location=3; cpro_position=1; cpro_follow=1; cpro_close=1; cpro_clientw=0; cpro_template='float_xuanfusld_120_270'; cpro_contw=900; cpro_w=120; cpro_h=270; cpro_float=1; cpro_cad=1; </script> <script language='JavaScript' type='text/javascript' src='http://cpro.baidu.com/cpro/ui/float.js'></script>

</script><script language=“javascript” src=“http://count40.51yes.com/click.aspx?id=405556073&logo=1” charset=“gb2312”></script>

</BODY></HTML>

1) , 2) , 3)
chatime)/(1000*60*60*24*7
在线工具/预产期计算.txt · 最后更改: 2019/02/17 14:58 由 welog