How can I perform calculations based on a chosen date?