I’m working on making a “dial” on the side of the watch face that shows the cutout of the day - month.
As of now, I have most of it working, but a small issue pops up when the current day is the first of the month. The issue is the previous day will show up as a zero. (I have it coded as ([DAY_1_31]-1) which works for all but the first day)
Ideally, I’d like it to display the last day of the previous month. So instead of a zero it would show 28(29), 30, or 31 depending on what the last day of the month was for the previous month. I’ve been digging through the forum and cant seem to find anything around that. I’m also not sure if it’s possible to get that value from the Unix date either.
You may need to do it with if else tag expressions
E.g ( (([DAY]-1) ==0) * (((([MON]-1)==1)*31)) + (([DAY]-1) ==0) * ((([MON]-1)==3)*31)) + (([DAY]-1) ==0) * ((([MON]-1)==4)*30)) …) + (([DAY]-1>0) * ([DAY] - 1)))
And so on… not sure the calculation for feb(leaps yr)
You have to add conditions tag for when ([MON] - 1==2)
Via caculating if leap yr a not
Sudo code:
if day is 1st day of the month. Take month subtract one and display the end date of that month.
E.g if today is 1st feb then = if 2 - 1 = 1(jan) then it be 31
And so on.
If day is not 1st day of the month. Do your day - 1
It was just remark about my observation, not a question. I know how to mimic real date ring (even if not using one at all), its much easier than to calculate the previous and following date of actual months.
Actually u are right just need to have a ring with all the numbers 1 to 31 (space properly) and rotate to the angle that display the date in the cutout.
Alternatively u could instead of caculate like what i explained earlier @WxmanGary u could mimick peter observations by setting your previous date to 31 if day - 1 = 0
That is the text field displaying previous day
([DAY-1]==0)? 31 : ([DAY-1])
Then for text field
After current date
([DAY+1]==32)? 1 : ([DAY]+1)
@WxmanGary
Sorry didnt think of this earlier, was just answering as what your topic was titled