Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
release/1.3.10 (#54)
Browse files Browse the repository at this point in the history
* Adds related check for PHP 7.1 Date/Time object changes. (#53)
* Uses an explicit PHP version check in order to run the correct setTime() method version.
* Fixes bug with close time not selecting the correct array element for hours.
* Fixes #52
  • Loading branch information
timnolte authored Apr 16, 2019
1 parent b9f89ff commit aef75e5
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 28 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** woocommcerce, shipping, local pickup, checkout fields, ecommerce, e-commerce, wordpress ecommerce
**Requires at least:** 4.7
**Tested up to:** 5.1.1
**Stable tag:** 1.3.9
**Stable tag:** 1.3.10
**Requires PHP:** 5.6
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -69,6 +69,9 @@ The location, by default, is hooked to `woocommerce_admin_order_data_after_billi

## Changelog ##

### 1.3.10 ###
* Adds check for PHP 7.1+ Date/Time object changes and makes appropriate PHP version specific calls.

### 1.3.9 ###
* Fixes how the starting interval is set, especially during the middle of the current open/close pickup time.
* Sets end time 1 interval past it in order to have the end close pickup time be inclusive for pickup.
Expand Down
Binary file modified languages/woocommerce-local-pickup-time-cs_CZ.mo
Binary file not shown.
12 changes: 6 additions & 6 deletions languages/woocommerce-local-pickup-time-cs_CZ.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: WooCommerce Local Pickup Time\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-local-"
"pickup-time\n"
"POT-Creation-Date: 2019-04-04 11:53:07+00:00\n"
"POT-Creation-Date: 2019-04-12 03:59:39+00:00\n"
"PO-Revision-Date: 2019-02-01 14:28:47+0000\n"
"Language: cs_CZ\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -288,9 +288,9 @@ msgid "Pickup Time:"
msgstr "Čas vyzvednutí:"

#: admin/class-local-pickup-time-admin.php:356
#: public/class-local-pickup-time.php:528
#: public/class-local-pickup-time.php:535
#: public/class-local-pickup-time.php:587
#: public/class-local-pickup-time.php:542
#: public/class-local-pickup-time.php:549
#: public/class-local-pickup-time.php:601
msgid "Pickup Time"
msgstr "Čas vyzvednutí"

Expand Down Expand Up @@ -326,11 +326,11 @@ msgstr "Neděle"
msgid "Select time"
msgstr "Vyberte čas"

#: public/class-local-pickup-time.php:555
#: public/class-local-pickup-time.php:569
msgid "Please select a pickup time."
msgstr "vyberte si čas vyzvednutí."

#: public/class-local-pickup-time.php:607
#: public/class-local-pickup-time.php:621
msgid "None"
msgstr "Žádná"

Expand Down
Binary file modified languages/woocommerce-local-pickup-time-en_US.mo
Binary file not shown.
12 changes: 6 additions & 6 deletions languages/woocommerce-local-pickup-time-en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: WooCommerce Local Pickup Time Select\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-local-"
"pickup-time\n"
"POT-Creation-Date: 2019-04-04 11:53:07+00:00\n"
"POT-Creation-Date: 2019-04-12 03:59:39+00:00\n"
"PO-Revision-Date: 2017-05-11 11:03+0200\n"
"Last-Translator: Karolína Vyskočilová <[email protected]>\n"
"Language-Team: Matt Banks <[email protected]>\n"
Expand Down Expand Up @@ -261,9 +261,9 @@ msgid "Pickup Time:"
msgstr ""

#: admin/class-local-pickup-time-admin.php:356
#: public/class-local-pickup-time.php:528
#: public/class-local-pickup-time.php:535
#: public/class-local-pickup-time.php:587
#: public/class-local-pickup-time.php:542
#: public/class-local-pickup-time.php:549
#: public/class-local-pickup-time.php:601
msgid "Pickup Time"
msgstr ""

Expand Down Expand Up @@ -299,11 +299,11 @@ msgstr ""
msgid "Select time"
msgstr ""

#: public/class-local-pickup-time.php:555
#: public/class-local-pickup-time.php:569
msgid "Please select a pickup time."
msgstr ""

#: public/class-local-pickup-time.php:607
#: public/class-local-pickup-time.php:621
msgid "None"
msgstr ""

Expand Down
14 changes: 7 additions & 7 deletions languages/woocommerce-local-pickup-time.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Local Pickup Time Select 1.3.9\n"
"Project-Id-Version: WooCommerce Local Pickup Time Select 1.3.10\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/woocommerce-local-pickup-time\n"
"POT-Creation-Date: 2019-04-04 11:53:07+00:00\n"
"POT-Creation-Date: 2019-04-12 03:59:39+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -266,9 +266,9 @@ msgid "Pickup Time:"
msgstr ""

#: admin/class-local-pickup-time-admin.php:356
#: public/class-local-pickup-time.php:528
#: public/class-local-pickup-time.php:535
#: public/class-local-pickup-time.php:587
#: public/class-local-pickup-time.php:542
#: public/class-local-pickup-time.php:549
#: public/class-local-pickup-time.php:601
msgid "Pickup Time"
msgstr ""

Expand Down Expand Up @@ -304,11 +304,11 @@ msgstr ""
msgid "Select time"
msgstr ""

#: public/class-local-pickup-time.php:555
#: public/class-local-pickup-time.php:569
msgid "Please select a pickup time."
msgstr ""

#: public/class-local-pickup-time.php:607
#: public/class-local-pickup-time.php:621
msgid "None"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woocommerce-local-pickup-time",
"version": "1.3.9",
"version": "1.3.10",
"description": "Add an an option to WooCommerce checkout pages for Local Pickup that allows the user to choose a pickup time.",
"main": "Gruntfile.js",
"scripts": {
Expand Down
24 changes: 19 additions & 5 deletions public/class-local-pickup-time.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Local_Pickup_Time {
*
* @var string
*/
const VERSION = '1.3.9';
const VERSION = '1.3.10';

/**
* Unique identifier for plugin.
Expand Down Expand Up @@ -461,8 +461,12 @@ public function build_pickup_time_options() {
$pickup_datetime->modify( '+1 day' );

// Reset the interval starting time.
$pickup_datetime->setTime( 0, 0, 0, 0 );

// Note: PHP pre-7.1 doesn't support milliseconds with the setTime() call.
if ( ! defined( 'PHP_VERSION' ) || ! function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '7.1.0', '<' ) ) {
$pickup_datetime->setTime( 0, 0, 0 );
} else {
$pickup_datetime->setTime( 0, 0, 0, 0 );
}
}

return $pickup_options;
Expand Down Expand Up @@ -492,13 +496,23 @@ public function build_pickup_time_intervals( $pickup_timestamp, $minutes_interva

// Set the open DateTime to the configured open time.
$pickup_day_hours_time_array = explode( ':', $pickup_day_open_time );
$pickup_open_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1] );
// Note: PHP pre-7.1 doesn't support milliseconds with the setTime() call.
if ( ! defined( 'PHP_VERSION' ) || ! function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '7.1.0', '<' ) ) {
$pickup_open_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1], 0 );
} else {
$pickup_open_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1], 0, 0 );
}

// Initialize ending DateTime based on day closed time.
$pickup_end_datetime = new DateTime( "@$pickup_timestamp" );
// Set ending hour based on close time.
$pickup_day_hours_time_array = explode( ':', $pickup_day_close_time );
$pickup_end_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1] );
// Note: PHP pre-7.1 doesn't support milliseconds with the setTime() call.
if ( ! defined( 'PHP_VERSION' ) || ! function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '7.1.0', '<' ) ) {
$pickup_end_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1], 0 );
} else {
$pickup_end_datetime->setTime( $pickup_day_hours_time_array[0], $pickup_day_hours_time_array[1], 0, 0 );
}
// Advance to 1 interval past the close time so that close time is inclusive.
$pickup_end_datetime->modify( "+$minutes_interval minute" );

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://mattbanks.me
Tags: woocommcerce, shipping, local pickup, checkout fields, ecommerce, e-commerce, wordpress ecommerce
Requires at least: 4.7
Tested up to: 5.1.1
Stable tag: 1.3.9
Stable tag: 1.3.10
Requires PHP: 5.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -69,6 +69,9 @@ The location, by default, is hooked to `woocommerce_admin_order_data_after_billi

== Changelog ==

= 1.3.10 =
* Adds check for PHP 7.1+ Date/Time object changes and makes appropriate PHP version specific calls.

= 1.3.9 =
* Fixes how the starting interval is set, especially during the middle of the current open/close pickup time.
* Sets end time 1 interval past it in order to have the end close pickup time be inclusive for pickup.
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-local-pickup-time.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: WooCommerce Local Pickup Time Select
* Plugin URI: http://mattbanks.me
* Description: Add an an option to WooCommerce checkout pages for Local Pickup that allows the user to choose a pickup time.
* Version: 1.3.9
* Version: 1.3.10
* Author: Matt Banks
* Author URI: http://mattbanks.me
* Text Domain: woocommerce-local-pickup-time
Expand Down

0 comments on commit aef75e5

Please sign in to comment.