Skip to content

Instantly share code, notes, and snippets.

@ItsRab
Created August 2, 2014 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ItsRab/28d9d7c50907c7293882 to your computer and use it in GitHub Desktop.
Save ItsRab/28d9d7c50907c7293882 to your computer and use it in GitHub Desktop.
Handle the dates when I’m available
<?php
// Work out when I’m available
// Manual, can set a date to use, e.g. 25th August
$date_available_manual = '';
// If no date is set, just set it to two weeks time
$date_available_auto = date('jS F', strtotime('+2 week'));
// Assign variable to echo out
if (!empty($date_available_manual)) {
$date_available = $date_available_manual;
}
else {
$date_available = $date_available_auto;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment