- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Thaks Paul, but I know nothing about Javascript (or FormCalc for that matter). I did find some code that is simlar to what you described, but I don't know how to manipulate it to work in LiveCycle designer. Can this work in a DateField?
-Leonardo
-----------------------------------------------
<script type="text/javascript">
window.onload=function(){
nowAndThen();
}
function nowAndThen() {
days=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
now=new Date();
yy=now.getUTCFullYear();
mm=now.getUTCMonth();
dt=now.getUTCDate();
dd=now.getUTCDay();
now=now.toLocaleDateString();
switch(dd) {
case 0:dd=5;dt5=dt+8;
break;
case 1:dd=1;dt5=dt+7;
break;
case 2:dd=2;dt5=dt+7;
break;
case 3:dd=3;dt5=dt+9;
break;
case 4:dd=4;dt5=dt+7;
break;
case 5:dd=5;dt5=dt+7;
break;
case 6:dd=5;dt5=dt+6;
break;
}
forwardfive=new Date(yy,mm,dt5).toLocaleDateString();
document.getElementById('today').firstChild.nodeValue='Today is '+now;
document.getElementById('ahead5').firstChild.nodeValue='Five business days ahead it will be '+forwardfive;
}
</script>
Views
Replies
Total Likes