diff --git a/.travis.yml b/.travis.yml index 56d018e..ae3b8e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ notifications: branches: only: - master + - /^dev\-release\/.*$/ - /^feature\/.*$/ - /^fix\/.*$/ diff --git a/README.md b/README.md index 41028ca..4a4f081 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ **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.0 -**Stable tag:** 1.3.7 +**Tested up to:** 5.1.1 +**Stable tag:** 1.3.8 **Requires PHP:** 5.6 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -69,6 +69,9 @@ The location, by default, is hooked to `woocommerce_admin_order_data_after_billi ## Changelog ## +### 1.3.8 ### +* Fixes issue with recognizing the current date/time as the start of the pickup time selection. + ### 1.3.7 ### * Fixes an issue with not using the WordPress locale and built-in language pack to translate the pickup date output on checkout. diff --git a/languages/woocommerce-local-pickup-time-cs_CZ.mo b/languages/woocommerce-local-pickup-time-cs_CZ.mo index eba3985..10fe596 100644 Binary files a/languages/woocommerce-local-pickup-time-cs_CZ.mo and b/languages/woocommerce-local-pickup-time-cs_CZ.mo differ diff --git a/languages/woocommerce-local-pickup-time-cs_CZ.po b/languages/woocommerce-local-pickup-time-cs_CZ.po index 5f5129d..c57125a 100644 --- a/languages/woocommerce-local-pickup-time-cs_CZ.po +++ b/languages/woocommerce-local-pickup-time-cs_CZ.po @@ -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-03-13 03:39:41+00:00\n" +"POT-Creation-Date: 2019-03-16 02:32:03+00:00\n" "PO-Revision-Date: 2019-02-01 14:28:47+0000\n" "Language: cs_CZ\n" "MIME-Version: 1.0\n" @@ -284,9 +284,9 @@ msgid "Pickup Time:" msgstr "Čas vyzvednutí:" #: admin/class-local-pickup-time-admin.php:356 -#: public/class-local-pickup-time.php:517 -#: public/class-local-pickup-time.php:524 -#: public/class-local-pickup-time.php:576 +#: public/class-local-pickup-time.php:515 +#: public/class-local-pickup-time.php:522 +#: public/class-local-pickup-time.php:574 msgid "Pickup Time" msgstr "Čas vyzvednutí" @@ -322,11 +322,11 @@ msgstr "Neděle" msgid "Select time" msgstr "Vyberte čas" -#: public/class-local-pickup-time.php:544 +#: public/class-local-pickup-time.php:542 msgid "Please select a pickup time." msgstr "vyberte si čas vyzvednutí." -#: public/class-local-pickup-time.php:596 +#: public/class-local-pickup-time.php:594 msgid "None" msgstr "Žádná" diff --git a/languages/woocommerce-local-pickup-time-en_US.mo b/languages/woocommerce-local-pickup-time-en_US.mo index 887fe70..5554fc8 100644 Binary files a/languages/woocommerce-local-pickup-time-en_US.mo and b/languages/woocommerce-local-pickup-time-en_US.mo differ diff --git a/languages/woocommerce-local-pickup-time-en_US.po b/languages/woocommerce-local-pickup-time-en_US.po index e6ecb8a..14c55d3 100644 --- a/languages/woocommerce-local-pickup-time-en_US.po +++ b/languages/woocommerce-local-pickup-time-en_US.po @@ -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-03-13 03:39:41+00:00\n" +"POT-Creation-Date: 2019-03-16 02:32:03+00:00\n" "PO-Revision-Date: 2017-05-11 11:03+0200\n" "Last-Translator: Karolína Vyskočilová \n" "Language-Team: Matt Banks \n" @@ -259,9 +259,9 @@ msgid "Pickup Time:" msgstr "" #: admin/class-local-pickup-time-admin.php:356 -#: public/class-local-pickup-time.php:517 -#: public/class-local-pickup-time.php:524 -#: public/class-local-pickup-time.php:576 +#: public/class-local-pickup-time.php:515 +#: public/class-local-pickup-time.php:522 +#: public/class-local-pickup-time.php:574 msgid "Pickup Time" msgstr "" @@ -297,11 +297,11 @@ msgstr "" msgid "Select time" msgstr "" -#: public/class-local-pickup-time.php:544 +#: public/class-local-pickup-time.php:542 msgid "Please select a pickup time." msgstr "" -#: public/class-local-pickup-time.php:596 +#: public/class-local-pickup-time.php:594 msgid "None" msgstr "" diff --git a/languages/woocommerce-local-pickup-time.pot b/languages/woocommerce-local-pickup-time.pot index 2681221..4601743 100644 --- a/languages/woocommerce-local-pickup-time.pot +++ b/languages/woocommerce-local-pickup-time.pot @@ -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.7\n" +"Project-Id-Version: WooCommerce Local Pickup Time Select 1.3.8\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/woocommerce-local-pickup-time\n" -"POT-Creation-Date: 2019-03-13 03:39:41+00:00\n" +"POT-Creation-Date: 2019-03-16 02:32:03+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -264,9 +264,9 @@ msgid "Pickup Time:" msgstr "" #: admin/class-local-pickup-time-admin.php:356 -#: public/class-local-pickup-time.php:517 -#: public/class-local-pickup-time.php:524 -#: public/class-local-pickup-time.php:576 +#: public/class-local-pickup-time.php:515 +#: public/class-local-pickup-time.php:522 +#: public/class-local-pickup-time.php:574 msgid "Pickup Time" msgstr "" @@ -302,11 +302,11 @@ msgstr "" msgid "Select time" msgstr "" -#: public/class-local-pickup-time.php:544 +#: public/class-local-pickup-time.php:542 msgid "Please select a pickup time." msgstr "" -#: public/class-local-pickup-time.php:596 +#: public/class-local-pickup-time.php:594 msgid "None" msgstr "" diff --git a/package.json b/package.json index 0ff100e..e72a76d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "woocommerce-local-pickup-time", - "version": "1.3.7", + "version": "1.3.8", "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": { diff --git a/public/class-local-pickup-time.php b/public/class-local-pickup-time.php index 27449e5..de25067 100644 --- a/public/class-local-pickup-time.php +++ b/public/class-local-pickup-time.php @@ -25,7 +25,7 @@ class Local_Pickup_Time { * * @var string */ - const VERSION = '1.3.7'; + const VERSION = '1.3.8'; /** * Unique identifier for plugin. @@ -445,7 +445,7 @@ public function build_pickup_time_options() { $minutes_interval, $pickup_day_open_time, $pickup_day_close_time, - ( 0 === $days ) + ( 1 === $days ) ) ); @@ -475,8 +475,7 @@ public function build_pickup_time_options() { public function build_pickup_time_intervals( $pickup_timestamp, $minutes_interval, $pickup_day_open_time, $pickup_day_close_time, $first_interval = false ) { // Initialize starting DateTime. - $pickup_start_datetime = new DateTime(); - $pickup_start_datetime->setTimestamp( $pickup_timestamp ); + $pickup_start_datetime = new DateTime( "@$pickup_timestamp" ); // Check pickup day interval start against day open time. if ( $pickup_start_datetime->format( 'G:i' ) < $pickup_day_open_time || ( ( ! $first_interval ) && $pickup_start_datetime->format( 'G:i' ) > $pickup_day_open_time ) ) { @@ -487,8 +486,7 @@ public function build_pickup_time_intervals( $pickup_timestamp, $minutes_interva } // Initialize ending DateTime based on day closed time. - $pickup_end_datetime = new DateTime(); - $pickup_end_datetime->setTimestamp( $pickup_timestamp ); + $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] ); diff --git a/readme.txt b/readme.txt index d3ca0d3..6b2bb8d 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: mjbanks, vyskoczilova, tnolte 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.0 -Stable tag: 1.3.7 +Tested up to: 5.1.1 +Stable tag: 1.3.8 Requires PHP: 5.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -69,6 +69,9 @@ The location, by default, is hooked to `woocommerce_admin_order_data_after_billi == Changelog == += 1.3.8 = +* Fixes issue with recognizing the current date/time as the start of the pickup time selection. + = 1.3.7 = * Fixes an issue with not using the WordPress locale and built-in language pack to translate the pickup date output on checkout. diff --git a/woocommerce-local-pickup-time.php b/woocommerce-local-pickup-time.php index cea438e..0cb5739 100644 --- a/woocommerce-local-pickup-time.php +++ b/woocommerce-local-pickup-time.php @@ -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.7 + * Version: 1.3.8 * Author: Matt Banks * Author URI: http://mattbanks.me * Text Domain: woocommerce-local-pickup-time