Frances Xavier Cabrini - St Cloud, FL

Change type of mass times from bar to Sat and Sun

Assigned to
Kyle Sullivan, Web Development at Diocesan Kyle S.
Due on
Notes
Im not sure if this is an easy switch. Feel free to talk to me before you do it if it will take more than 10 mins.

Comments & Events

Kyle Sullivan, Web Development at Diocesan
I'm not certain, but this looks a lot like a component I'd built before. I think it's a relatively easy switch to just display Saturday and Sunday, but I'd hate to lose this functionality.

I can look into this more, but it shouldn't be too bad.
Kyle Sullivan, Web Development at Diocesan
Here's the code that was there. I'd hate to lose it.
<?php
/**
 * Template part for displaying mass times on the homepage
 *
 * @package louismemphis
 */

?>

<?php

// set timezone
#date_default_timezone_set('America/Chicago');

// $dtz = new DateTimeZone("America/New_York");
// find today's day of the week
$today = new DateTime('NOW' , new DateTimeZone("America/New_York"));
// $today = new DateTime('NOW');
// $today = date('l');
$today = strtolower($today->format('l'));

// find tomorrow
// $tomorrow = date('l', strtotime("+1 day") );
$tomorrow = new DateTime('tomorrow' , new DateTimeZone("America/New_York"));
$tomorrow = strtolower($tomorrow->format('l'));
// $dayAfterTomorrow = date('l', strtotime('+2 day') );
// $dayAfterTomorrow = strtolower($dayAfterTomorrow);

// find current time
$currentTime = new DateTime('NOW' , new DateTimeZone("America/New_York"));
$currentTime = strtolower($currentTime->format('H:i:s'));

$mass_times = get_field('mass_times', 'option');

?>
	<div class="time">
		<?php $currentlang = get_bloginfo('language');
		if($currentlang=="en-US"): ?>
			<div class="mass-time-label fontHeader">Today</div>
		<?php elseif($currentlang=="es-ES"): ?>
			<div class="mass-time-label fontHeader">Hoy</div>
		<?php endif; ?>
		<?php
		// if ( have_rows( 'mass_times', 'option' ) ) :
		// 	while ( have_rows( 'mass_times', 'option' ) ) : the_row();
				$countTodaysTimes = count(get_field($today,'options'));
				$counter = 0;
				if ( have_rows( $today,'options' ) ) { ?>
					<div class="timeContainer fontHeader">
					<?php while ( have_rows( $today,'options' ) ) : the_row();
						$time = get_sub_field('time');
						$timeDescription = get_sub_field('time_description');
						if ( $counter == 0 ) {
							// echo ucwords($today) . ' at ' . $time;
							echo $time . ' ' . $timeDescription;
						}
						if ( $counter > 0 ) {
							if ( $counter == $countTodaysTimes-1 ) {
								echo ' & ' . $time . ' ' . $timeDescription;
							}
							else {
								echo ', ' . $time . ' ' . $timeDescription;
							}
						}
						$counter++;
					endwhile; ?>
				</div>
				<?php }

			// endwhile;

			if ( $counter == 0 ) {
				echo 'See Full Schedule';
			}

		// endif;

		?>

	</div>

	<div class="time mobileHidden">
		<?php $currentlang = get_bloginfo('language');
		if($currentlang=="en-US"): ?>
			<div class="mass-time-label fontHeader">Tomorrow</div>
		<?php elseif($currentlang=="es-ES"): ?>
			<div class="mass-time-label fontHeader">Mañana</div>
		<?php endif; ?>
		<?php
		// if ( have_rows( 'mass_times', 'option' ) ) :
		// 	while ( have_rows( 'mass_times', 'option' ) ) : the_row();
				$countTodaysTimes = count(get_field($tomorrow,'options'));
				$counter = 0;
				if ( have_rows( $tomorrow,'options' ) ) { ?>
					<div class="timeContainer fontHeader">
					<?php while ( have_rows( $tomorrow,'options' ) ) : the_row();
						$time = get_sub_field('time');
						$timeDescription = get_sub_field('time_description');
						if ( $counter == 0 ) {
							// echo ucwords($tomorrow) . ' at ' . $time;
							echo $time . ' ' . $timeDescription;
						}
						if ( $counter > 0 ) {
							if ( $counter == $countTodaysTimes-1 ) {
								echo ' & ' . $time . ' ' . $timeDescription;
							}
							else {
								echo ', ' . $time . ' ' . $timeDescription;
							}
						}
						$counter++;
					endwhile;?>
					</div>
				<?php }

			// endwhile;

			if ( $counter == 0 ) {
				echo 'See Full Schedule';
			}

		// endif;

		?>
	</div>

<?php // echo $today; ?>
<?php // echo $time; ?>
Kyle Sullivan, Web Development at Diocesan
I've rebuilt this component to meet what I believe are the client's specifications.
Kyle Sullivan, Web Development at Diocesan
Kyle Sullivan completed this to-do.