The fact that tags don’t autocorrect for leap years is MADDENING.
Like, trying to design a countdown to a specific date, that will adjust for leap years, is mind-breaking. For instance, if I want a countdown of days 'til Christmas, or days 'til New Years Eve… it can eiter be accurate for a leap year or non, but not both. Why doesn’t it compensate properly.
Even tried getting different layers to appear only on leap years, and not non-leap( and vice versa is) … like… ARGH. Why isn’t there an IF/THEN for leap years.
I don’t know what you mean by “tags don’t autocorrect”.
To compute countdowns to certain date tag [DAY_IN_YEAR] is mostly used. On last day of this year it will return 366 instead 365, because this year is a leap year. What else should it do?
Because it is not needed.
You need to add 1 on leap year, that is all. How you “compensate” for that in your formula?
Attach to it this: +([YEAR]%4==0)
I am trying to get a Countdown working correctly . I am not a real Coder . I get there by trial and error . I have got the leap years but a formula stage works for any date before or after the end of February eludes me. Sadly I have got to the stage in my life where I am not getting more clever by the day .
I will post where I got to later .
I have heard of people using 2 separate formulas on two layers .
.
.
This is what I am working on . I actually got this originaly from Facer and have tried to port it . It has errors on Facer as well . I can not sort it by trial and error . It is predicting the days till Halloween but fails to give the correct number of days the day after .
.
+([YEAR]%4==0) was the solution. Thank you. I was ready to just leave it as “+1” and update it after the leap year was over, tbh.
You’re a hero. A mathmagician, if you will. Thank you.
The tag expressions listed on the Samsung Developer Site list [YEAR] as displaying the current representing year. I didn’t even think about using it, with additional math coding. … ugh. #FacePalm You have no idea how long I’ve been trying to figure this out. There wasn’t any resources specifying it anywhere. And I couldn’t understand why there wasn’t a code specific to leap years, just like that one. Or like, an auto-correction. yadda-yadda.
I can’t even tell you how many different approaches I went thru, with [MON_DAY], [DAY_IN_YEAR], and on and on and on. …
Sincerely, I appreciate the time you took to give me an answer.
You are welcome. Thanks for praise, but even though what I proposed works most of times, it is not the definitive solution. It rather had to point you to use the year number as a base for deciding what year it is.
As @russellcresser pointed, there are times when just adding +1 on leap year may not be accurate if the counted to date is before february 29 or for the rest of year past the inspected date on year before leap year.