PHP’s strtotime function makes working with user-inputted dates wonderfully simple…as long as you’re American. For the rest of us, here’s a simple way to make it correctly interpret dates in day/month/year order.


I wanted to make a better Gift Aid calculator for UK charity websites—one that’s easier to use, more eye-catching, and better explains how Gift Aid actually works. So I built one for the University of York. This tutorial will help you to build one too.

The second part of this tutorial will cover the thing that makes my Gift Aid calculator distinctive: its design. There I will also outline the design flaws of the existing Gift Aid calculators, which led me to work on an alternative. But before we work on the calculator’s layout and aesthetics, we first need the basic JavaScript that makes a Gift Aid calculator work. Follow this first part of the tutorial to find out how to do that.


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now