1、 |
人口统计学中年龄自动计算脚本 |
(1) |
<script language="javascript"> function getAge(){ var subjid=va_getValue('subjid'); var where1 = "obj.subjid = '"+ subjid +"'"; var icdat=av_private_getDate(va_getLinkValue('dm','icfdat',where1,'obj.subjid desc')).getTime(); var brthdat=av_private_getDate(va_getValue('brthdtc')).getTime(); var year=(icdat-brthdat)/86400000/365.25; va_setValue('age',Math.floor(year));
} </script>
|
(2) |
<script language="javascript"> function getAge(){ var icfdat_value = va_getValue('icfdat'); //alert(icfdat_value); var brthdtc_value = va_getValue('brthdtc'); //alert(brthdtc_value); if(icfdat_value != '' && brthdtc_value != ''){ var year=va_timeDiff('icfdat','brthdtc')/86400000/365.25; va_setValue('age',Math.floor(year)); }else{ va_setValue('age',''); } } </script> |
(3) |
<script language="javascript"> function getAge(){ var subjid=va_getValue('subjid'); var where1 = "obj.subjid = '"+ subjid +"'"; var icdat=av_private_getDate(va_getValue('icfdat')).getTime(); var brthdat=av_private_getDate(va_getValue('brthdtc')).getTime(); var year=(icdat-brthdat)/86400000/365.25; va_setValue('age',Math.floor(year));
} </script> |
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。