It's possible to disable date selection and to select a date from your program, and that's what we'll see on this example.
If isn't required that users could select a day on calendar, only interacting going through months, disabling days selection could be a good idea to avoid confusion. For that:
Also, regarding days selection, you could be interested to set a date to be highlighted on calendar from your code, maybe when a specific event happens, or after calendar creation. As
time output is in seconds, we define the number of seconds contained within a day as a constant:
Now let's select two days from current day:
Our example will look like this:
See the full source code calendar_example_04.c here.