• Hello!
    Our week start here at Sunday, but in this widget, sunday is the last day.
    How can i make that Sunday will be shown the first day of the week?

    Thanks!
    Daniel!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @danieling,

    Go to the Bookings > Settings > Schedule page in your WordPress admin area and change the “Week Starts On” setting to Sunday.

    Thread Starter danieling

    (@danieling)

    Hi @natewr
    Thanks for your replay, I am a newbie, what do you mean booking? It’s on the plugin or in the settings of the website?

    My website is configured in the general settings to
    “first day of the week: Sunday” (translated from Hebrew)

    Hi @danieling,

    You’ll find the scheduling settings in your WordPress admin area. The plugin documentation includes more information, as well as screenshots to help you find it:

    https://doc.themeofthecrop.com/plugins/restaurant-reservations/user/config/schedule

    Thread Starter danieling

    (@danieling)

    Hi @natewr,
    I don’t have the Restaurant Reservations plugin installed, i have Business Profile.
    I installed it to check if it will work, the first day of the week was already Sunday and it shows Sunday in the end of the line, after Thursday.

    I found in the template-functions.php file

    $weekdays_i18n = array(
    ‘monday’ => esc_html__( ‘Mo’, ‘business-profile’ ),
    ‘tuesday’ => esc_html__( ‘Tu’, ‘business-profile’ ),
    ‘wednesday’ => esc_html__( ‘We’, ‘business-profile’ ),
    ‘thursday’ => esc_html__( ‘Th’, ‘business-profile’ ),
    ‘friday’ => esc_html__( ‘Fr’, ‘business-profile’ ),
    ‘saturday’ => esc_html__( ‘Sa’, ‘business-profile’ ),
    ‘sunday’ => esc_html__( ‘Su’, ‘business-profile’ ),

    If i change the order, will it help?
    Or there is simple way to do this?
    *My website is Hebrew language, so the plugin is automatic translated
    Thanks

    • This reply was modified 7 years, 1 month ago by danieling.

    Hi @danieling,

    I’m sorry, my mistake. I forgot to look at which plugin this support ticket relates to.

    Unfortunately, there’s no setting to change the start date of the opening hours in Business Profile. Instead, I think you will need to use a custom template for the opening hours. You can learn more about the templating system here:

    https://doc.themeofthecrop.com/plugins/business-profile/developer/templates

    Thread Starter danieling

    (@danieling)

    Hi @natewr,
    Thanks for the help,
    Unfortunately it didn’t work for me to modify the template opening hours(newbe), but what did work is editing template-functions.php and class-custom-post-types.php.
    I changed the array that the week start on Sunday.
    I guess that every update i will have to redo it.
    Is there a simple code i can put in the template that will do it permanently?

    Thanks in advance,
    Daniel

    $weekdays_i18n = array(
    ‘sunday’ => esc_html__( ‘Su’, ‘business-profile’ ),
    ‘monday’ => esc_html__( ‘Mo’, ‘business-profile’ ),
    ‘tuesday’ => esc_html__( ‘Tu’, ‘business-profile’ ),
    ‘wednesday’ => esc_html__( ‘We’, ‘business-profile’ ),
    ‘thursday’ => esc_html__( ‘Th’, ‘business-profile’ ),
    ‘friday’ => esc_html__( ‘Fr’, ‘business-profile’ ),
    ‘saturday’ => esc_html__( ‘Sa’, ‘business-profile’ ),

    Hi @danieling,

    A couple of quick ideas. First, if you don’t need to be able to modify the opening hours through the web interface, you can just hard-code the times into the template:

    
    	<div class="bp-weekday">
    		<span class="bp-weekday-name">Monday</span>
    		<span class="bp-times">
    			<span class="bp-time">9am-3pm</span>
    		</span>
    	</div>
    	... repeaat for each day
    

    Second, if you skip the first loop you’ll miss sunday and can print it at the end. Something like this:

    
    	<?php foreach ( $data->weekday_hours as $weekday => $times ) : ?>
    	<?php if ($weekday === 'sunday') { continue; } ?>
    	<div class="bp-weekday">
    		<span class="bp-weekday-name bp-weekday-<?php echo $weekday; ?>"><?php echo $data->weekday_names[$weekday]; ?></span>
    		<span class="bp-times">
    		<?php foreach ( $times as $time ) : ?>
    			<span class="bp-time"><?php echo $time; ?></span>
    		<?php endforeach; ?>
    		</span>
    	</div>
    	<?php endforeach; ?>
    	<?php foreach ( $data->weekday_hours as $weekday => $times ) : ?>
    	<?php if ($weekday !== 'sunday') { continue; } ?>
    	<div class="bp-weekday">
    		<span class="bp-weekday-name bp-weekday-<?php echo $weekday; ?>"><?php echo $data->weekday_names[$weekday]; ?></span>
    		<span class="bp-times">
    		<?php foreach ( $times as $time ) : ?>
    			<span class="bp-time"><?php echo $time; ?></span>
    		<?php endforeach; ?>
    		</span>
    	</div>
    	<?php endforeach; ?>
    

    It’s not pretty but it should do the trick. Note that I haven’t tested the code. But hopefully you get the idea.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Week start on Sunday’ is closed to new replies.