Created
February 5, 2020 12:38
-
-
Save amolok/2433fa4889eae398e125b1471ea3369f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($start && date("Y") != $start) { | |
$output = $start.'–'.date("Y"); | |
} else { | |
if($start)$output = $start; | |
else $output = date("Y"); | |
} | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Displays start year to current year or just current year:
2020–2021
Usage:
Create MODx snippet named
year
and copypaste gist into it.Put this chunk in your footer template:
[[!year? &start=`2019`]]