How to get day from a date and automatically add days - Printable Version +- Forums (https://bdn.bdb.ai) +-- Forum: BDB Knowledge Base (https://bdn.bdb.ai/forumdisplay.php?fid=13) +--- Forum: BDB Dashboards Designer (https://bdn.bdb.ai/forumdisplay.php?fid=43) +---- Forum: BDB Designer Q & A (https://bdn.bdb.ai/forumdisplay.php?fid=16) +---- Thread: How to get day from a date and automatically add days (/showthread.php?tid=626) |
How to get day from a date and automatically add days - archana - 12-23-2022 Script:- var today = new Date(d); var day=today.getDay(); if(day==1) { var days5 = new Date(new Date().setDate(today.getDate() + 5)); var full5=days5.getFullYear()+'-'+(days5.getMonth() + 1)+'-'+days5.getDate(); sdk.setValue( 'date104',full5 ); } else if((day==2)||(day==3)||(day==4)||(day==5)||(day==6)) { var days6 = new Date(new Date().setDate(today.getDate() + 6)); var full6=days6.getFullYear()+'-'+(days6.getMonth() + 1)+'-'+days6.getDate(); sdk.setValue( 'date104',full6 ); } |