I have both these dynamic calendar scripts working separately in my app drawer, but when I tried making the new…
//go to the icon picker and search the 31 items. Long click the first one (it will be copied) and paste it here between the brackets
var link = [ “com.thaphlash.random”, “today_1” ]
//This is the label of the item to put the icon to
var labelName = “Today Settings”;
//write true to set the calendar based on the month. By default it’s false: based on the day
var month=false;
//end of config
if(link.length==0){alert(“follow the instructions and paste the icon properties in the script”);return;}
LL.bindClass(“java.util.Calendar”);
var now=Calendar.getInstance().get(month?Calendar.MONTH:Calendar.DAY_OF_MONTH);
if(month)now++;
//only when change, or run from item
if(now.toString()==LL.getScriptTag()&&LL.getEvent().getSource()!=”MENU_ITEM”)return;
LL.setScriptTag(now);
var iconPackName = link[0];
var prefixName = link[1].substring(0,link[1].length-1);
var item=LL.getEvent().getContainer().getItemByLabel(labelName);
if(item==null){alert(“no item found, make sure the label is the same as in the script”); return;}
var icon=LL.createImage(iconPackName,prefixName+now);
if(icon==null){alert(“no icon found, make sure the pasted data is right and the icon pack have it”);return;}
item.setCustomIcon(icon);//go to the icon picker and search the 31 items. Long click the first one (it will be copied) and paste it here between the brackets
var link = [ “com.thaphlash.random”, “calendar_1” ]
//This is the label of the item to put the icon to
var labelName = “Calendar”;
//write true to set the calendar based on the month. By default it’s false: based on the day
var month=false;
//end of config
if(link.length==0){alert(“follow the instructions and paste the icon properties in the script”);return;}
LL.bindClass(“java.util.Calendar”);
var now=Calendar.getInstance().get(month?Calendar.MONTH:Calendar.DAY_OF_MONTH);
if(month)now++;
//only when change, or run from item
if(now.toString()==LL.getScriptTag()&&LL.getEvent().getSource()!=”MENU_ITEM”)return;
LL.setScriptTag(now);
var iconPackName = link[0];
var prefixName = link[1].substring(0,link[1].length-1);
var item=LL.getEvent().getContainer().getItemByLabel(labelName);
if(item==null){alert(“no item found, make sure the label is the same as in the script”); return;}
var icon=LL.createImage(iconPackName,prefixName+now);
if(icon==null){alert(“no icon found, make sure the pasted data is right and the icon pack have it”);return;}
item.setCustomIcon(icon);
]]>
< ![CDATA[
Oh, yes. The problem is that, when it checks if the day hasn’t changed, the second time it always return true.
Remove this lines of the second subscript where it says:
//only when change, or … … … setScriptTag(now);
]]>
< ![CDATA[
Awesome! Mission accomplished 😂.. Thanks TrianguloY….. Yet again! and to the rest of the guys around here at LL, It’s a great community you have Pierre Hébert
]]>
< ![CDATA[
Adam Caine WOW . Just wow
]]>