Date plus and minus 1 day

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

I think it might a problem with Boolean Logic of conditions.
Try this for february:
$#DM#=1||#DM#=2&&(#Dd#-1)=0?31:0$
$#DM#=1||#DM#=2&&(#Dd#-1)=0?100:0$

If it won’t work we will need to create even more elements.

1 Like

OK thanks, is this layer 6?

1 Like

No, number 2.
From:

into

1 Like

OK, so put: $#DM#=1||#DM#=2&&(#Dd#-1)=0?31:0$$#DM#=1||#DM#=2&&(#Dd#-1)=0?100:0$ in to layer 2 TEXT setting now there’s a latent 0 from the 2nd to 28th Feb

1 Like

No, you put $#DM#=1||#DM#=2&&(#Dd#-1)=0?31:0$ into text and $#DM#=1||#DM#=2&&(#Dd#-1)=0?100:0$ into transparency, that was just the way Facer forum shows quotes.

1 Like

Thanks, I should have looked more carefully expression was twice as long and had two $$ in the middle.

It worked! nice one

1 Like

I wish I did but I don’t know how to apply it to the other 7 layers

1 Like

Ok, if that works here are all the layers again:

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

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

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

4:
$#DM#=8||#DM#=9&&(#Dd#-1)=0?31:0$
$#DM#=8||#DM#=9&&(#Dd#-1)=0?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:
$#DM#=5||#DM#=7&&(#Dd#-1)=0?30:0$
$#DM#=5||#DM#=7&&(#Dd#-1)=0?100:0$

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

Let me know what works.

1 Like