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
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
3 participants