Skip to content

Commit

Permalink
Release 6.1.6
Browse files Browse the repository at this point in the history
* Fix for multi-day packages where the last line has no end time
* Fix wrongful error after clearing cache
  • Loading branch information
Ugoku committed Jul 18, 2024
1 parent 93b9cd8 commit 2e4a2c7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
## 6.1.6 (2024-07-18)
* Fix for multi-day packages where the last line has no end time
* Fix wrongful error after clearing cache

## 6.1.5 (2024-07-16)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recras-wordpress-plugin",
"version": "6.1.5",
"version": "6.1.6",
"description": "Recras WordPress plugin",
"main": "index.js",
"directories": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: zanderz
Tags: recras, recreation, reservation, booking, voucher
Tested up to: 6.6
Stable tag: 6.1.5
Stable tag: 6.1.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -80,6 +80,10 @@ No. "Must use" plugins don't appear in the update notifications nor show their u

== Changelog ==

= 6.1.6 =
* Fix for multi-day packages where the last line has no end time
* Fix wrongful error after clearing cache

= 6.1.5 =
* Fix programme of multi-day package

Expand Down
2 changes: 1 addition & 1 deletion recras-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Recras WordPress Plugin
Plugin URI: https://www.recras.nl/
Version: 6.1.5
Version: 6.1.6
Description: Easily integrate your Recras data into your own site
Requires at least: 6.4
Requires PHP: 7.3.0
Expand Down
9 changes: 8 additions & 1 deletion src/Arrangement.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ public static function generateProgramme(array $lines, string $startTime = '00:0
$startDatetime = $startDatetime->add(new \DateInterval($firstInProgramme->duration));

// Whether a package is multi-day can depend on the start time (i.e. a 4-hour package starting at 22:00)
$progEnd = end($programme);
$progEnd = $firstInProgramme;
$lastEnd = null;
foreach ($programme as $line) {
if ($line->end > $lastEnd) {
$progEnd = $line;
}
}

$endDatetime = new \DateTime($startTime);
$endDatetime->add(new \DateInterval($progEnd->begin));
$endDatetime->add(new \DateInterval($progEnd->duration));
Expand Down

0 comments on commit 2e4a2c7

Please sign in to comment.