Is there anyways to check national holidays in each countries?

I am in Japan, there are some national country holidays, I would like to change weekdays color on holidays. I know I could not do this on GWS, is there anyways to accomplish this feature in WFS?

I have not been using Watch Face Studio for very long so there may be a better way to accomplish this. I don’t think there is an easy way to check for holidays, but I would try using tag expressions to calculate the holidays you want to recognize. I don’t think you can actually change the color of an element with tag expressions, but I know you can change the fill percent/opacity of an element’s color with tag expressions, which can be used to effectively hide or show an item.

I am assuming you already have an element for your weekday color, so you could duplicate that element and make sure the duplicate element sits above/over the top of the original element in the list on the left of Watch Face Studio. Choose your color for holidays, and make that color the new element’s color.

Click in the input box for the opacity of the new element’s color and set the value to zero, then click on the little “tags” button that shows up. The new holiday color element will disappear from the design/preview screen when you click the “tags” button because you just set the opacity to zero.

To make the new element reappear only on January 1st, put the following expression into the text input of the tags popup, then press the “Done” button. You can test that it works the way you want it to work by changing the date in the “Run” preview panel.

[DAY_IN_YEAR] == 1 ? 100 : 0

This ternary tag expression is a way to use IF / THEN / ELSE logic. So this expression reads as: “IF it is the first day of the year, THEN make the opacity 100, ELSE on any other day of the year, make the opacity zero.”

If you need to make the holiday color element appear on more than one day in a year, you can chain conditions together. For example, if you want to show the holiday color element on January 1st and February 11th you could use the following tag expression:

([DAY_IN_YEAR] == 1) + ([DAY_IN_YEAR] == 42) ? 100 : 0

This expression reads as: “IF it is the first day of the year (January 1st) OR IF it is the 42nd day of the year (February 11th) THEN make the opacity 100, ELSE on any other days of the year, make the opacity zero.”

You can keep adding more day of the year checks to the beginning of this expression until you run out of space in the tag expression input field. To avoid unexpected results, each condition needs to be enclosed in parenthesis () and separated by the plus + sign, which means “OR” in logic tag expressions.

I am not familiar with Japan’s calendar so I do not know if leap year is observed. If it is, it will complicate your expression logic for any dates after February 28. For example, normally April 29 would be day number 119, but on leap year it would be day number 120.

If you have holidays that do not occur on the exact same day number every year, that may also complicate things. I think in that case you might have to consider using tags like [WEEK_IN_MON] or [WEEK_IN_YEAR].

If you haven’t found this web page already, here is a Samsung Developer web page that provides a lot of detail about tag expressions: Tag expressions | Samsung Developer. Also, this link is a “day of year” reference chart you can use: Day of Year Chart

I hope this helps you to create the functionality you want. If anyone has a better or more efficient way to tackle this problem, please share it with us. :slight_smile:

2 Likes