Calculate the number of nights between two datepickers

I want to know how to set a calculate to count the days?
Just like the demo

I also copy the code, but the days can’t update the new data

What demo are you using? Where are you using the code that you copied?

E xplain what you are trying to do, what works, and what doesn’t. Also, add any code in a code block as stated in the Forum Guidelines.