Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:refresh_age

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:refresh_age [2018/01/10 21:23] – [Explanation] toby_goodlocktips:refresh_age [2018/01/26 19:25] (current) – [Example] toby_goodlock
Line 4: Line 4:
  
 ===== Example ===== ===== Example =====
-  '{dh24}' > (string.sub('{wlu}',1,2)) and (string.sub('Updated ',1,8))..(({DM}+60) - (string.sub('{wlu}',4,5)))..' min ago' or (string.sub('Updated ',1,8)..{DM} - (string.sub('{wlu}',4,5)))..' min ago'+  ('{dh23}'=='0' and (string.sub('{wlu}',1,2)=='23')) and (string.sub('Updated ',1,8))..(({dm}+60)-(string.sub('{wlu}',4,5)))..' min ago' or'{dh23z}' > (string.sub('{wlu}',1,2)) and (string.sub('Updated ',1,8))..(({DM}+60) - (string.sub('{wlu}',4,5)))..' min ago' or(string.sub('Updated ',1,8)..{DM} - (string.sub('{wlu}',4,5)))..' min ago'
  
 ===== Explanation ===== ===== Explanation =====
-By using this formula in the text field we are comparing the current hour (1-24) to the hour of the last refresh+By using this formula in the text field we are comparing the current hour (00-23) to the hour of the last refresh.
-We use {dh24} instead of {dh23} because in the case of 12am comparing to 11pm we would use the values 24 > 23. +
- +
-This is with the assumption that you are using 12 hour or 24 hour (0-23) formatting for your time.+
  
 If the current hour is greater then we add 60 to the current minute and subtract the last refresh minutes value. If the current hour is greater then we add 60 to the current minute and subtract the last refresh minutes value.
  
 If the hours are the same we simply subtract the last refresh minutes from the current minutes. If the hours are the same we simply subtract the last refresh minutes from the current minutes.
 +
 +For 12am, we check if the current hour is 00 and if the last refresh hour is 23 and if so make the current hour 24 to do our math.
  
  
tips/refresh_age.1515619438.txt.gz · Last modified: 2018/01/10 21:23 by toby_goodlock