Hi all
Hi all
Could you tell me what is false here ?
My day name must be in red and not in yellow
Checked with alert and day name is mercredi
]]>« Hello (Previous Post)
(Next Post) Hey.. I just updated LL for the first time in like a month and haven’t been paying attention to bugs here.. »
< ![CDATA[
Perhaps you need to use first capital letter (Samedi, Dimanche, Mercredi)
]]>
< ![CDATA[
TrianguloY tried the same.
set an alert and no caps
]]>
< ![CDATA[
Use instead
[0,1,2].indexOf(0)!=-1 //true
[0,1,2].indexOf(3)!=-1 //false
]]>
< ![CDATA[
This doesn’t work because keys in this array are not ‘samedi’, ‘dimanche’, ‘mercredi’ but 0, 1, 2. These day names are values only, not keys in an associative array.
]]>
< ![CDATA[
So
“samedy” in {samedy:0,dimanche:0,mercredi:0}
Should work…yes, it works 😀
]]>
< ![CDATA[
I didn’t want to suggest this crude hack but I knew someone else would 😉
]]>
< ![CDATA[
TrianguloY brilliant
]]>
< ![CDATA[
Pierre Hébert​ is it possible to set a condition without : (else). it’s giving an error, asking for :
And to have more than 1 if ligne ? 
]]>
< ![CDATA[
https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
]]>
< ![CDATA[
TrianguloY​​ ok so no way to avoid the else here
Trying the if
Edit : yessss many “if” working well
]]>
< ![CDATA[
In the binding edition popup you can tap on the pen icon to display the full script editor (easier for multiline):
if(condition1) {
 do1();
} else if(condition2) {
 do2();
} else if(condition3) {
 do3();
}
]]>
< ![CDATA[
Pierre Hébert I was only changing when error and chosing View script
Thank you
]]>
< ![CDATA[
Pierre Hébert TrianguloY​
Could you help me there
I have syntax error line 3
if ($ll_day_name = ‘lundi’){
return 0xffffaa00;
else if ($ll_day_name = ‘jeudi’) {
return 0xffff0000;
else if ($ll_day_name = ‘mercredi’) {
return 0xffff0000;
else return 0xffffffff ;
}
Working fine with only if. Trying else and I’m lost
]]>
< ![CDATA[
== instead of =
]]>
< ![CDATA[
Pierre Hébert always syntax error
if ($ll_day_name == ‘lundi’){
return 0xffffaa00;
else if ($ll_day_name == ‘jeudi’) {
return 0xffff0000;
else if ($ll_day_name == ‘mercredi’) {
return 0xffff0000;
else return 0xffffffff ;
}
]]>
< ![CDATA[
several missing } …
]]>
< ![CDATA[
Pierre Hébert at the end ?
]]>
< ![CDATA[
post edited above
if() {} else if() {} else if() {} else {}
]]>
< ![CDATA[
Pierre Hébert ok thanks. Working well
]]>