Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:forecast_days

How to Calculate Forecast Days

If you want to add the weather forecast to your watch but aren't sure how to get the day names correct, use the below examples for days 1-5. This uses the {ddw0} tag to calculate the next 5 day names.

Example

Day 1

 {ddw0} +1==1 and 'Mon' or {ddw0} +1==2 and 'Tue' or {ddw0} +1==3 and 'Wed' or {ddw0} +1==4 and 'Thu' or {ddw0} +1==5 and 'Fri' or {ddw0} +1==6 and 'Sat' or {ddw0} +1==7 and 'Sun'

Day 2

 {ddw0} +2==2 and 'Tue' or {ddw0} +2==3 and 'Wed' or {ddw0} +2==4 and 'Thu' or {ddw0} +2==5 and 'Fri' or {ddw0} +2==6 and 'Sat' or {ddw0} +2==7 and 'Sun' or {ddw0} +2==8 and 'Mon'

Day 3

 {ddw0} +3==3 and 'Wed' or {ddw0} +3==4 and 'Thu' or {ddw0} +3==5 and 'Fri' or {ddw0} +3==6 and 'Sat' or {ddw0} +3==7 and 'Sun' or {ddw0} +3==8 and 'Mon' or {ddw0} +3==9 and 'Tue'

Day 4

 {ddw0} +4==4 and 'Thu' or {ddw0} +4==5 and 'Fri' or {ddw0} +4==6 and 'Sat' or {ddw0} +4==7 and 'Sun' or {ddw0} +4==8 and 'Mon' or {ddw0} +4==9 and 'Tue' or {ddw0} +4==10 and 'Wed'

Day 5

 {ddw0} +5==5 and 'Fri' or {ddw0} +5==6 and 'Sat' or {ddw0} +5==7 and 'Sun' or {ddw0} +5==8 and 'Mon' or {ddw0} +5==9 and 'Tue' or {ddw0} +5==10 and 'Wed' or {ddw0} +5==11 and 'Thu'

Explanation

Because the {ddw0} tag uses the values 0-6 for the days of the week we are simply adding 1-5 to the current value to figure out the correct day name.

tips/forecast_days.txt · Last modified: 2018/01/09 14:45 by toby_goodlock