Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:weatherage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tips:weatherage [2015/03/06 02:50]
chaco [Change Current Temp Color] missing a {
tips:weatherage [2020/06/27 23:08]
beachbumjk
Line 17: Line 17:
 Now, there is a slight problem with this formula, since it can't cross midnight.  In other words, if weather updates at 23:59, but it's currently 00:01, it will **not** indicate as current.  But, that's a minor quibble.  It could be fixed, but it'd mean testing for date as well which would complicate the formula considerably for such a small gain, especially since a quick "update weather" tap action immediately resolves the issue. Now, there is a slight problem with this formula, since it can't cross midnight.  In other words, if weather updates at 23:59, but it's currently 00:01, it will **not** indicate as current.  But, that's a minor quibble.  It could be fixed, but it'd mean testing for date as well which would complicate the formula considerably for such a small gain, especially since a quick "update weather" tap action immediately resolves the issue.
  
 +===== Additional =====
  
 +The above works well when the Settings:Time:Override 12 / 24 Hour setting is set to "No override". Changing the example somewhat however results in it working when in 12 or 24 hour format.
 +
 +===== Example 2 =====
 +
 +====Change Current Temp Color 2 ====
 +   Tint:  ((({dtp}>.5 and ({dh24}<12 and {dh24}+12 or {dh24}) or {dh24})*60)+{dm})-((string.sub('{wlu}',1,2)*60)+(string.sub('{wlu}',4,5)))<5 and 'ffffff' or 'ffff00'
 +
 +===== Explanation =====
 +{dh24} is relative to the Time Override setting and displays as 12 or 24 based on that setting. {dtp} represents the day as a percentage of 24 hours (% 24 hours) regardless of that setting and can therefore be used in determining if past midday. Then by either leaving {dh24} as is if in 24 hour mode or offsetting it by 12 if in 12 hour mode the elapsed minutes are correctly obtained.
tips/weatherage.txt ยท Last modified: 2020/06/27 23:08 by beachbumjk