Skip to content

Commit

Permalink
Migrate to Craft 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MDXDave committed Dec 5, 2024
1 parent c8a2c47 commit 1b1c958
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.2.0 - 2024-12-06
- Support for Craft CMS 5.x

## 1.1.0 - 2022-06-09
- Support for Craft CMS 4.x

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# TimeAgo plugin for Craft CMS 4.x

Displays time ago for a given timestamp value within a Craftcms3 Twig template.
Displays time ago for a given timestamp value within a Craft CMS Twig template.

## Requirements

This plugin requires Craft CMS 4.0.0 or later.
This plugin requires Craft CMS 5.0.0 or later.

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "mdxdave/time-ago",
"description": "Displays time ago for timestamp",
"description": "Displays the time has been past since a given date",
"type": "craft-plugin",
"version": "1.1.0",
"version": "1.2.0",
"keywords": [
"craft",
"cms",
Expand All @@ -22,7 +22,7 @@
}
],
"require": {
"craftcms/cms": "^4.0.0",
"craftcms/cms": "^4.0.0|^5.0.0",
"nesbot/carbon": "^2.0.0"
},
"config": {
Expand All @@ -41,7 +41,7 @@
"extra": {
"name": "TimeAgo",
"handle": "time-ago",
"schemaVersion": "1.1.0",
"schemaVersion": "1.2.0",
"hasCpSettings": false,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/mdxdave/time-ago/master/CHANGELOG.md",
Expand Down
4 changes: 2 additions & 2 deletions src/TimeAgo.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* TimeAgo plugin for Craft CMS 3.x
* TimeAgo plugin for Craft CMS 5.x
*
* Shows time ago postDate
*
* @link https://mdxdave.de
* @copyright Copyright (c) 2017 MDXDave
* @copyright Copyright (c) 2024 MDXDave
*/

namespace mdxdave\timeago;
Expand Down
6 changes: 3 additions & 3 deletions src/twigextensions/TimeAgoTwigExtension.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* TimeAgo plugin for Craft CMS 4.x
* TimeAgo plugin for Craft CMS 5.x
*
* Shows time ago postDate
*
* @link https://mdxdave.de
* @copyright Copyright (c) 2022 MDXDave
* @copyright Copyright (c) 2024 MDXDave
*/

namespace mdxdave\timeago\twigextensions;
Expand All @@ -28,7 +28,7 @@ public function getFilters()
];
}

function timeAgo($datetime, $lang="en") {
function timeAgo($datetime, $lang = "en") {
Carbon::setLocale($lang);
return Carbon::createFromTimestamp($datetime)->diffForHumans();
}
Expand Down

0 comments on commit 1b1c958

Please sign in to comment.