FACER Community

Countdown to Halloween

Hello! I am looking to create a countdown to Halloween. I already have the basic formula, but the problem I’m having is, when it gets to the end of the countdown, I end up with negative values until January 1st, and then it resets. How do you code it where it repeats from Halloween rather than having that negative value? Also, has anyone figured out how to account for leap years?

Thank you!!

2 Likes

Welcome @angeleyestiffany58 . Nice Idea but a bit of a Task for a Debut Face. I did a search here in the community with Countdown and came up with a bit of a jumble.
We have done this before for Christmas etc and the Geniuses have accounted for the Leap years.
We have visitors so I will not be on my Laptop yill later . I can send you some pointes then.
In the Meantime someone might pick this up and help you out.
I see you are an Apple User.
You will become a very popular Beta tester if you are up for it.
Have you got the rest of the Face ready.

2 Likes

@russellcresser Not yet, I decided to take a break from it cause I’ve been tinkering with it for 6 hours. Ha. I really appreciate you!
I opted in for beta yesterday so hopefully I can do well with it! :blush:

2 Likes

Yeah. It can take over all your spare time. Come back when you are ready.

2 Likes

I would try to use the clamp function where you can set the minimum value to “0”. Let me check, I did build a countdown timer a while ago…

3 Likes

@mrantisocialguy worked out the Math for a Christmas Countdown, and basing the idea that Halloween is on the 304th day of the year, I altered it and here it is (please let me know if it works ok for you, my Math is terrible but this seems to be ok) -
$(#Dy#/4)==floor(#Dy#/4)&&#DD#<=304?304-#DD#:$$(#Dy#/4)!=floor(#Dy#/4)&&#DD#<=304?304-#DD#:$$((#Dy#+1)/4)==floor((#Dy#+1)/4)?365-#DD#+360:$$(#Dy#/4)==floor(#Dy#/4)?366-#DD#+304:365-#DD#+304$

5 Likes

I did a 5 minute countdown, so upon wake up I countdown 5 minutes:
Text field: (5-floor((#DWE#)/60))

And once the minutes are up, I hide the number:
Opacitiy field: $#DWE#>359?0:100$

So, I guess the difficulty is finding out how much time is left from wakeup of the watch till halloween. And you would probably have to do the above for seconds, hours, days, etc.

But I see someone else has maybe a better idea and done this before…

2 Likes

Well done. @icrltd4 @mrantisocialguy et Alles.
That checks out perfectly.

$(#Dy#/4)==floor(#Dy#/4)&&#DD#<=304?304-#DD#:$$(#Dy#/4)!=floor(#Dy#/4)&&#DD#<=304?304-#DD#:$$((#Dy#+1)/4)==floor((#Dy#+1)/4)?365-#DD#+360:$$(#Dy#/4)==floor(#Dy#/4)?366-#DD#+304:365-#DD#+304$

Protected with anti fouling.

This has become a nice little Bookmarked Tutorial.

Job Done.

3 Likes

@russellcresser @icrltd4 Is there any way of doing it with the hours, minutes and seconds as well? Y’all are awesome!

Edit to add, I got most of it done and decided to test the watch face with what I do have, and it shows 85 days on my computer screen from facer, but when it’s on my watch it does this.
image

2 Likes

The countdown of hours, minutes, seconds is not so difficult.
Once it is halloween, I set the opacity to 0, so the countdown does not continue (visually that is…).

Take a look at the watch face here for details (inspection open; hope I got it right…):

2 Likes

So far I’ve gotten it to work on the program, but it still doesn’t work when the code is put together and sent to the watch.

1 Like

Yes, I see, on my watch the days do not display properly either. I’ll have a look…
On some watches long formulas with multiple conditions do not work. Maybe I can come up something easier…

1 Like

I really appreciate you! This is kind of a gift for someone. :sweat_smile:

1 Like

OK. I think I found a way.

Check my earlier post of the watch face. I have updated it.

Basically I did 2 different countdowns for the days, one for leap years, and one when it is not a leap year.

1 Like

It may not be possible at this time with Apple. I believe the community discussions related to countdowns were back before Facer offered Apple watch faces.

1 Like

Yeah Well done @tom.vannes. I think that is the only way. I am sure I read somewhere that Three conditionals on a line is the recommended Limit.
It could be incorporated into one conditional actualy.

1 Like

Did you get this to work on Apple - and keep working? (Reminds me of an old Timex commercial, “It’s still ticking…”

1 Like

Has anyone had a chance to test at least the days on an Apple watch yet? I can’t publish my countdown design unless I know that it works.