# Smooth Rotating Day of the Month Dials

There isn’t a tag for smooth day of the month rotation. I guess the reason is that the number days in a month varies, so there is no fixed rotation speed that could be applied.

For a 31-day date dial, the general formula to positioning dial to the date would be: ´#Dd#*11.61#`

(31 days in 360° gives you the 11.61°). You can add or subtract values, depending on how you dial looks like. In the 31-day dial below the rotation formula would be: `(#Dd#*11.61-11.61)`

That formula is the basis for a smooth rotation. The idea is to add a smooth rotation to that formula, #DWFHS# is good enough for this purpose.

I figured there are 2 solution to have a smooth rotating

1. Using 4 dials,
each with their own rotation speed, and using opacity to display one the dials depending on how many days there are in a month:

Dial 1, 1-31 days:

• Rotation: `(#DWFHS#/360*11.61+#Dd#*11.61-11.61)`
• Opacity: `\$#DIM#=31?100:0\$`

Dial 2, 1-30 days:

• Rotation: `(#DWFHS#/360*12+#Dd#*12-12)`
• Opacity: `\$#DIM#=30?100:0\$`

Dial 3, 1-29 days:

• Rotation: `(#DWFHS#/360*12.41+#Dd#*12.41-12.41)`
• Opacity: `\$#DIM#=29?100:0\$`

Dial 4, 1-28 days:

• Rotation: `(#DWFHS#/360*12.86+#Dd#*12.86-12.86)`
• Opacity: `\$#DIM#=28?100:0\$`

2. Using a single dial,
and transition/rotation to the 1st of the month when the end of the month has been reached.
So for this we can use the 31-day dial formula and add a condition and rotate onwards if #DIM# = #Dd#. I prefer this not to be jumpy but also smooth, so I add the interpAccel function to it.

The formula is:
`\$#DIM#=#Dd#?(#DWFHS#/360*11.61+#Dd#*11.61-11.61)+((interpAccel(#Dsm#,0,1,1))*11.65*(31-#DIM#)):(#DWFHS#/360*11.61+#Dd#*11.61-11.61)\$`

Explanation:

If condition is met, the rotate forwards by the number of days require. So in the case of February )non-leap year), there are only 28 days, so I need to rotate by 31-28=3 days. If condition is not met rotate as defined.

Working example with both options. Inner dial using a single dial, outer one is composed of the option with the 4 dials:

Advantage of the 4 dials: you’ll always have a smooth rotation
Disadvantage of a single dial: the dial rotates to “31” even if the current month may not have that many days, which seem a bit awkward.

But maybe someone a better idea…

6 Likes
6 Likes

Nice little Tutorial thanks, and some more Date Wheels for the collection too, awesome

3 Likes