XWidgetSoft Forum
https://www.bbs.xwidget.com/

Holiday Core??? (it would be very USEFUL)
https://www.bbs.xwidget.com/viewtopic.php?f=11&t=2302
Page 1 of 1

Author:  Armando [ November 17th, 2012, 8:44 am ]
Post subject:  Holiday Core??? (it would be very USEFUL)

Qiancang:
It would be great if there were a "core holiday" or something ...
In the following example: I would like the background of the day change to red when that day is a holiday ...
Perhaps there is a way to make writing a code ... but I do not know how that would be.
Thank you for your feedback!
Attachment:
background day.jpg
background day.jpg [ 30.77 KiB | Viewed 2475 times ]

Author:  qiancang [ November 17th, 2012, 6:58 pm ]
Post subject:  Re: Holiday Core??? (it would be very USEFUL)

a datetimecore is enough.
Code:
function datetimecore1OnUpdate(Sender)
{
  if(datetimecore1.get("%HolidayAll") != '')
  {
  text1.background.solidColor.color = rgba(255,0,0,255)
  image1.Src = "red.png";
  }

  else
  {
  text1.background.solidColor.color = rgba(0,0,0,255)
  image1.Src = widgetpath + "white.png"; // sometimes WidgetPath is necessary , you can delete it here
  }

}


you can write whatever you want in the if else body

Author:  Armando [ November 18th, 2012, 5:18 am ]
Post subject:  Re: Holiday Core??? (it would be very USEFUL)

Qiancang.... Thanks so much!!!! I will try your code.
It's very useful!!

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/