Skip to content

Commit 2a53362

Browse files
committed
Improve comments, fix PHPCS
1 parent bc67562 commit 2a53362

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/my-calendar-navigation.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function mc_nav( $date, $format, $time, $show_months, $id, $site = false ) {
280280
$prev_link = '';
281281
$next_link = '';
282282
if ( $prev ) {
283-
$prev_link = mc_build_url(
283+
$prev_link = mc_build_url(
284284
array(
285285
'yr' => $prev['yr'],
286286
'month' => $prev['month'],
@@ -289,7 +289,7 @@ function mc_nav( $date, $format, $time, $show_months, $id, $site = false ) {
289289
),
290290
array()
291291
);
292-
$prev_link = mc_url_in_loop( $prev_link );
292+
$prev_link = mc_url_in_loop( $prev_link );
293293
/**
294294
* Filter HTML output for navigation 'prev' link.
295295
*
@@ -303,7 +303,7 @@ function mc_nav( $date, $format, $time, $show_months, $id, $site = false ) {
303303
$prev_link = apply_filters( 'mc_previous_link', '<li class="my-calendar-prev"><a id="mc_previous_' . $id . '" href="' . $prev_link . '" rel="nofollow">' . wp_kses_post( $prev['label'] ) . '</a></li>', $prev );
304304
}
305305
if ( $next ) {
306-
$next_link = mc_build_url(
306+
$next_link = mc_build_url(
307307
array(
308308
'yr' => $next['yr'],
309309
'month' => $next['month'],
@@ -312,7 +312,7 @@ function mc_nav( $date, $format, $time, $show_months, $id, $site = false ) {
312312
),
313313
array()
314314
);
315-
$next_link = mc_url_in_loop( $next_link );
315+
$next_link = mc_url_in_loop( $next_link );
316316
/**
317317
* Filter HTML output for navigation 'next' link.
318318
*
@@ -528,7 +528,7 @@ function mc_export_links( $y, $m, $next, $add, $subtract ) {
528528
*
529529
* @return array of parameters for link
530530
*/
531-
function my_calendar_next_link( $date, $format, $time = 'month', $months = 1, $site = false) {
531+
function my_calendar_next_link( $date, $format, $time = 'month', $months = 1, $site = false ) {
532532
$bounds = mc_get_date_bounds( $site );
533533
$cur_year = (int) $date['year'];
534534
$cur_month = (int) $date['month'];
@@ -731,7 +731,7 @@ function my_calendar_prev_link( $date, $format, $time = 'month', $months = 1, $s
731731
if ( strtotime( $bounds['first'] ) > strtotime( $test_date ) ) {
732732
$output = false;
733733
} else {
734-
$output = array(
734+
$output = array(
735735
'month' => $month,
736736
'yr' => $yr,
737737
'day' => $day,
@@ -1043,14 +1043,14 @@ function mc_date_switcher( $type = 'calendar', $cid = 'all', $time = 'month', $d
10431043
$date_switcher .= "<option value='$i'" . selected( $test, $c_month, false ) . '>' . date_i18n( 'F', mktime( 0, 0, 0, $i, 1 ) ) . '</option>' . "\n";
10441044
}
10451045
$date_switcher .= '</select>' . "\n" . $day_switcher . ' <label class="maybe-hide" for="' . $cid . '-year">' . __( 'Year', 'my-calendar' ) . '</label> <select id="' . $cid . '-year" name="yr">' . "\n";
1046-
// Query to identify oldest start date in the database.
1046+
// Check first start date in the database.
10471047
$bounds = mc_get_date_bounds( $site );
10481048
$first = $bounds['first'];
1049-
$first = ( '1970-01-01 00:00:00' === $first ) ? '2000-01-01' : $first;
1050-
$year1 = (int) mc_date( 'Y', strtotime( $first, false ) );
1051-
$diff1 = (int) mc_date( 'Y' ) - $year1;
1052-
$past = $diff1;
1053-
1049+
$first = ( '1970-01-01 00:00:00' === $first ) ? '2000-01-01' : $first;
1050+
$year1 = (int) mc_date( 'Y', strtotime( $first, false ) );
1051+
$diff1 = (int) mc_date( 'Y' ) - $year1;
1052+
$past = $diff1;
1053+
// Check last end date.
10541054
$last = $bounds['last'];
10551055
$year2 = (int) mc_date( 'Y', strtotime( $last, false ) );
10561056
$diff2 = $year2 - (int) mc_date( 'Y' );

0 commit comments

Comments
 (0)