The code should be:
if ($datepicker)
{
mysqli_query($db, "INSERT INTO calendar (date)
VALUES ('" . mysqli_real_escape_string($db, $datepicker) . "')") or die(mysqli_error($db));
You left out the argument that specifies the database connection to use. This should have generated an error something like mysqli_query expects parameter 1 to be mysqli
.
I've added escaping of the data, and an error report if the insert fails.