Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render uniform WP time picker over default time input element #489

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

MaxwellGarceau
Copy link

@MaxwellGarceau MaxwellGarceau commented Jan 22, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable? Not applicable
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation? Documentation for this change would live on the WooCommerce Bookings side if needed

Changes proposed in this Pull Request:

  • Add the wc-bookings-render-wp-time-picker class to the time input on the Bookings -> Settings -> Accommodations admin menu to render a uniform time selector that follows sitewide time formats
  • Update documentation regarding local setup

Closes #364.

Steps to test the changes in this Pull Request:

Warning

**‼️‼️ NOTE - BLOCKED by WC BOOKINGS PR 3926: This change relies on code introduced in https://github.com/woocommerce/woocommerce-bookings/pull/3926.

Note

There is no chance of introducing bugs if this PR is merged first.
Without the WooCommerce Bookings PR there will be no change whatsoever in appearance or functionality of the input time selector. The only code change in this PR is adding the class that the JS uses to select and initialize the time picker.**

  1. Access the WordPress admin panel.
  2. Navigate to the "General" settings under "Settings" in the WordPress dashboard.
  3. In the "Time format" section, select the 24-hour time format (e.g., "20:00" for 8:00 PM).
  4. Save the changes.

image

  1. Navigate to the Accommodation Booking Setting within the plugin /wp-admin/edit.php?post_type=wc_booking&page=wc_bookings_settings&tab=accommodation
  2. You should see a time selector that adapts to the 24-hour time format
  3. Change the time format back to the 12 hour AM/PM configuration. The time selector on /wp-admin/edit.php?post_type=wc_booking&page=wc_bookings_settings&tab=accommodation should adapt to display the 12 hour format

Screenshot 2025-01-22 at 12 03 07 AM

Functionality - Admin

  1. Save a setting and refresh the page. The setting should persist.
  2. Perform with both 12 and 24 hour configuration.

Functionality - FE

  1. Set the check in and check out to a value (and remember the value) - /wp-admin/edit.php?post_type=wc_booking&page=wc_bookings_settings&tab=accommodation
  2. Create an Accommodation Product

Screenshot 2025-01-22 at 12 10 16 AM

  1. Navigate to the FE. You should set that the check in and check out time are the same as the value you saved.

Screenshot 2025-01-22 at 12 11 24 AM

Changelog entry

Add - Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

README.md Outdated Show resolved Hide resolved
Co-authored-by: Darin Kotter <[email protected]>
@vikrampm1 vikrampm1 added this to the Future Release milestone Jan 27, 2025
@Sourabh208 Sourabh208 requested review from Sourabh208 and removed request for ankitguptaindia January 28, 2025 07:26
Copy link
Contributor

@Sourabh208 Sourabh208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Status: Need Information/Need Fixes ⚠️

  1. Save a setting and refresh the page. The setting should persist. ✅
  2. Perform with both 12 and 24 hour configuration. ⚠️ When a user changes the settings from 24 to 12 hours, it shows 24 hours clock. @MaxwellGarceau Can you please help if any step I missed? Please watch video 1.

Video 1:

Screen.Recording.2025-01-28.at.13.01.41.mov

Testing Environment - Local

@MaxwellGarceau
Copy link
Author

Hey @Sourabh208 thanks for the QA notes.

Possible cause of the problem

Just to confirm, are the changes from https://github.com/woocommerce/woocommerce-bookings/pull/3926 active in your testing environment?

The reason I ask is because this change uses a CSS class that was introduced in https://github.com/woocommerce/woocommerce-bookings/pull/3926 to initialize the JS time picker that transforms the default <input type="time" /> element.

Based on the testing video 1 it seems that the JS time picker isn't being applied.

Solutions

The easy way

Assuming what I said above is accurate, the easiest option would be letting https://github.com/woocommerce/woocommerce-bookings/pull/3926 go through to the development cycle first and making it into production before QA'ing this ticket.

The hard way

Another option would be manually setting up your testing environment to use branch fix/3633 in WooCommerce Bookings and building the plugin with the build steps documented in the readme. This is definitely more work. If you're testing on a remote environment you could try to SSH into the environment and upload the built fix/3633 branch or if you have access to FTP you could drag/drop it.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accommodation Booking Setting doesn't follow WP Time format Setting
4 participants