Date plus and minus 1 day

I’m trying to make a dial that reveals the previous and following day number for the week #DdL# please can I request the code to do this: example when watch display 20 day, I need to be able to show the 19 and 21, thanks in advance

2 Likes

Do you want a text based code or a rotating one (hand)?

1 Like

Hi Mellin, thanks for responding, a text based one based on #DdL#

1 Like

Ok, a text based one.
I can tell you right now that there is no way to create a fully working one for -1 day, there will be at least 1 day in every 3 days on which it will show the wrong number - 1st of March of any Leap year.

The +1 day should be no problem.

Give some time to think about it.

Edit- Scratch that, there is a way to overcome that problem, but it’s gone take a few text elements showing up and hiding.

1 Like

What i’m trying to do is create what looks like a rotating dial without actually making one, just want the numbers above and below the DAY number to be before and after, got any ideas?

1 Like

Next one (+1) is gone be easy so I will start with that one:

$(#Dd#+1)>#DIM#?1:(#Dd#+1)$

Check and let me know if it works.

1 Like

Yes, brilliant worked perfectly, thanks

1 Like

The -1 gone take some thinking (since there is no tag that gives back number of the day in the previous month).
I will be giving first text and then transparency code for it.

first element:
$(#Dd#-1)=0?0:#Dd#$
$(#Dd#-1)=0?0:100$

2:
$(#Dd#-1)=0&&#DM#=1||#DM#=2?31:0$
$(#Dd#-1)=0&&#DM#=1||#DM#=2?100:0$

3:
$(#Dd#-1)=0&&#DM#=4||#DM#=6?31:0$
$(#Dd#-1)=0&&#DM#=4||#DM#=6?100:0$

4:
$(#Dd#-1)=0&&#DM#=8||#DM#=9?31:0$
$(#Dd#-1)=0&&#DM#=8||#DM#=9?100:0$

5:
$(#Dd#-1)=0&&#DM#=11?31:0$
$(#Dd#-1)=0&&#DM#=11?100:0$

6 (end of February for a Leap year)
$(#Dd#-1)=0&&#DM#=3&&#DD#=61?29:0$
$(#Dd#-1)=0&&#DM#=3&&#DD#=61?100:0$

7 (end of February for a non Leap year):
$(#Dd#-1)=0&&#DM#=3&&#DD#=60?28:0$
$(#Dd#-1)=0&&#DM#=3&&#DD#=60?100:0$

8:
$(#Dd#-1)=0&&#DM#=5||#DM#=7?30:0$
$(#Dd#-1)=0&&#DM#=5||#DM#=7?100:0$

9:
$(#Dd#-1)=0&&#DM#=12||#DM#=10?30:0$
$(#Dd#-1)=0&&#DM#=12||#DM#=10?100:0$

2 Likes

Wow, that’s amazing, I really hadn’t thought it through. You have a quick mind, I was just thinking of having the day before when the current day is the 1st showing as blank.

Does your code allow for all eventualities and if so do I execute as follows:

If I understand it, I need to create 9 layers for the day before location and then add your code to the text and transparency code respectively can you confirm that’s right please?

1 Like

That would be yes and yes.

1 Like

Again, thank you znakomity!!!

2 Likes

Hi Mellin, put in the code and it’s not working it shows the same day?. Also noticed you used Dd, I also tried DdL for a leading zero

1 Like

maybe just the previous day to be zero transparency when current day is 1, but also can the previous and next have leading zero?

1 Like

1 Like

1 Like

Sorry, my bad.

First element should have:

$(#Dd#-1)=0?0:(#Dd#-1)$
1 Like

Hi Mellin, that worked perfectly. Also forget the question about leading zero I’ll run it with the #Dd# it actually looks better.
Thank you

1 Like

Hi Mellin, there seems to be a problem with February see screen grab. Just want to check when you sat first element should be you are referring to first layer is that correct?

1 Like

When you select day between 2 and the end of a month it should always give back (#Dd#-1).

Am I understanding it correctly that for some reason there is also a 31 showing up?
Can you check which one?

And I was refering to layer I mentioned as the first one for -1
From:
$(#Dd#-1)=0?0:#Dd#$
To:
$(#Dd#-1)=0?0:(#Dd#-1)$

1 Like

Hi, OK so the following months have this issue:
1st day of month is OK all other days have 31 in background

  • Feb
  • June
  • July
  • Sept
  • Oct
1 Like