Lcd clock and Rotary encoder.

I am making a clock using a Pcf 8563p as the (RTC) chip. The clock displays on an LCD and I can change the time and date using a Rotary encoder. But TWO things are bothering me and would like some advice on how to solve the following.

1, The date displays as mm/dd/yyyy and I would like dd/mm/yyyy

2, I use a rotary encoder to move through the menu. But, when I want to change either the Time or Date I have to keep pressing the encoder button to increment the digits. Also when I come out of the variable I have set. The digits I had just set increment by an additional 1. so for example if I set the hours to 10 by pressing down on the encoder button then Rotate the encoder to the Minutes the Hour becomes 11.

How do I stop this additional digit increment, and what do I change in my code to increment the digits using “Rotary action” of the encoder instead of the “Push button action” of the encoder.

Heres the code attached below

Clock Sketch.txt (11.8 KB)

rest of code to follow

Instead of doing several posts with a fraction of the program in each, attach the whole file. At the bottom when you write your post, "Additional options" ...