https://github.com/statamic/another_date
Display a date other than the current date on your Statamic site.
https://github.com/statamic/another_date
Last synced: 3 months ago
JSON representation
Display a date other than the current date on your Statamic site.
- Host: GitHub
- URL: https://github.com/statamic/another_date
- Owner: statamic
- Created: 2014-06-23T19:21:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-27T13:52:24.000Z (about 9 years ago)
- Last Synced: 2025-02-15T20:57:09.346Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Another Date 
Display a date other than the current date on your Statamic site. (Note that you can also display the current date with this add-on.)
## Installation
Drop this repository's `another_date` folder into your site's `_add-ons` folder.
## Usage
```html
Yesterday was {{ another_date when="yesterday" format="F j, Y" }}.
```## Parameters
- `when` is the date to display, this gets run through PHP's `strtotime` function, so relative dates and any dates that accept will work here (for example: `tomorrow`, `+24 days`, `April 2, 2014`), by default, this will use the current date/time
- `format` is the date formatting to use, again, based on PHP's date formatting, by default this will use your site's configured `_date_format`