Posts: 745
Threads: 33
Joined: Oct 2008
Dean,
I want to hide the Christmas SiriusXM command buttons on my template  if month isn't December.  
Any hint on the best and hopefully easiest way to hide these two command button if month (not equal)  "12"?
thanks 
Kevin
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Posts: 40,483
Threads: 491
Joined: Aug 2002
The easiest way would just be, OnPreload, get the date and check the month and mark them hidden if not Dec. Of course it wouldn't go away if you left that screen up on New Years. It would stay until you left that screen and came back. But that's not too big a deal.
Dean Roddey
Explorans limites defectum
Posts: 745
Threads: 33
Joined: Oct 2008
(12-12-2018, 10:07 AM)Dean Roddey Wrote: The easiest way would just be, OnPreload, get the date and check the month and mark them hidden if not Dec. Of course it wouldn't go away if you left that screen up on New Years. It would stay until you left that screen and came back. But that's not too big a deal.
This does not seem to work.(would be nice). Or do I need to use a FormatTimeVal call instead.
System::GetDateParts
    P1=[local]
    P2=LVar  ay
    P3=LVar:Mon
    P4=LVar:Year
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Posts: 745
Threads: 33
Joined: Oct 2008
(12-13-2018, 04:47 AM)kfly Wrote: (12-12-2018, 10:07 AM)Dean Roddey Wrote: The easiest way would just be, OnPreload, get the date and check the month and mark them hidden if not Dec. Of course it wouldn't go away if you left that screen up on New Years. It would stay until you left that screen and came back. But that's not too big a deal.
This does not seem to work.(would be nice). Or do I need to use a FormatTimeVal call instead.
System::GetDateParts
    P1=[local]
    P2=LVar ay
    P3=LVar:Mon
    P4=LVar:Year
This seems to work fine(getting current month). Just seemed that GetDateParts would be cleaner. 
thx
System::FormatTimeVal
    P1=[local]
    P2=GVar:Mon
    P3=Pattern
    P4=\%(M)
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Posts: 40,483
Threads: 491
Joined: Aug 2002
That guy doesn't accept [local], it expects a real time stamp. It could do that, but it currently doesn't. I guess it's mainly assuming you'll be processing time stamps from driver fields because, strangely, there is no way in an action to get the current time stamp. I need to add a command for that as well.
Dean Roddey
Explorans limites defectum
Posts: 40,483
Threads: 491
Joined: Aug 2002
GetTime/DateParts now will accept [local] as a special case of the time stamp, as of 5.3.921. There is also a System::GetCurTimeStamp command to get the current stamp into a variable. Best to create a variable of time type to put it into, but a string one will work and it'll just get formatted to text.
Dean Roddey
Explorans limites defectum
|