define script expression
Posted: Fri Aug 23, 2019 3:59 pm
Hi!
maybe someone can help me write the script expression in switch on a condition with variables.
I would like to compare the Proper Job Name (it is: "2019_08_23") with the scripted comparison value like this:
var pubdate = new Date();
var pubdateday = pubdate.getDate()+"";
var edd = pubdateday
if (edd < 10)
{
edd = "0" + pubdateday;
}
else
{
edd = pubdateday;
};
var pubdatemonth = (pubdate.getMonth()+1)+"";
var edm = pubdatemonth
if (edm < 10)
{
edm = "0" + pubdatemonth;
}
else
{
edm = pubdatemonth;
};
var pubdateyear = (pubdate.getYear()*1 +1900)+"";
var today = pubdateyear + "_" + edm + "_" + edd;
pubdate = today;
The scripted value "pubdate" is correct "2019_08_23" but I think I have to tell switch, that the Proper Job Name is meant?!
thx all for your help!
maybe someone can help me write the script expression in switch on a condition with variables.
I would like to compare the Proper Job Name (it is: "2019_08_23") with the scripted comparison value like this:
var pubdate = new Date();
var pubdateday = pubdate.getDate()+"";
var edd = pubdateday
if (edd < 10)
{
edd = "0" + pubdateday;
}
else
{
edd = pubdateday;
};
var pubdatemonth = (pubdate.getMonth()+1)+"";
var edm = pubdatemonth
if (edm < 10)
{
edm = "0" + pubdatemonth;
}
else
{
edm = pubdatemonth;
};
var pubdateyear = (pubdate.getYear()*1 +1900)+"";
var today = pubdateyear + "_" + edm + "_" + edd;
pubdate = today;
The scripted value "pubdate" is correct "2019_08_23" but I think I have to tell switch, that the Proper Job Name is meant?!
thx all for your help!