Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhill2020 committed Jun 18, 2024
1 parent ab4922a commit 777dacd
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 41 deletions.
30 changes: 24 additions & 6 deletions includes/abstracts/feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,20 @@ public function set_earliest_event($timestamp = 0)
if ('days_before' == $earliest_date) {
$earliest = $start->subDays($earliest_range)->getTimestamp();
} elseif ('weeks_before' == $earliest_date) {
$earliest = $start->subWeeks($earliest_range)->addDay()->getTimestamp();
$earliest = $start
->subWeeks($earliest_range)
->addDay()
->getTimestamp();
} elseif ('months_before' == $earliest_date) {
$earliest = $start->subMonths($earliest_range)->addDay()->getTimestamp();
$earliest = $start
->subMonths($earliest_range)
->addDay()
->getTimestamp();
} elseif ('years_before' == $earliest_date) {
$earliest = $start->subYears($earliest_range)->addDay()->getTimestamp();
$earliest = $start
->subYears($earliest_range)
->addDay()
->getTimestamp();
} else {
$earliest = $start->getTimestamp();
}
Expand Down Expand Up @@ -221,11 +230,20 @@ public function set_latest_event($timestamp = 0)
if ('days_after' == $latest_date) {
$latest = $start->addDays($latest_range)->getTimestamp();
} elseif ('weeks_after' == $latest_date) {
$latest = $start->addWeeks($latest_range)->subDay()->getTimestamp();
$latest = $start
->addWeeks($latest_range)
->subDay()
->getTimestamp();
} elseif ('months_after' == $latest_date) {
$latest = $start->addMonths($latest_range)->subDay()->getTimestamp();
$latest = $start
->addMonths($latest_range)
->subDay()
->getTimestamp();
} elseif ('years_after' == $latest_date) {
$latest = $start->addYears($latest_range)->subDay()->getTimestamp();
$latest = $start
->addYears($latest_range)
->subDay()
->getTimestamp();
} else {
$latest = $start->getTimestamp();
}
Expand Down
49 changes: 23 additions & 26 deletions includes/admin/metaboxes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,17 @@ private static function calendar_settings_panel($post)
</th>
<td>
<?php
$fixed = get_post_meta($post->ID, '_display_print_calendar', true);
$fixed = get_post_meta($post->ID, '_display_print_calendar', true);

simcal_print_field([
'type' => 'checkbox',
'name' => '_display_print_calendar',
'id' => '_display_print_calendar',
'tooltip' => __(
'Check this to display print calendar button on frontend.',
'google-calendar-events'
),
'value' => 'yes' == $fixed ? 'yes' : 'no',
'text' => __('Yes (Display Print Calendar Button)', 'google-calendar-events'),
]);
?>
simcal_print_field([
'type' => 'checkbox',
'name' => '_display_print_calendar',
'id' => '_display_print_calendar',
'tooltip' => __('Check this to display print calendar button on frontend.', 'google-calendar-events'),
'value' => 'yes' == $fixed ? 'yes' : 'no',
'text' => __('Yes (Display Print Calendar Button)', 'google-calendar-events'),
]);
?>
</td>
</tr>
<tr class="simcal-panel-field">
Expand All @@ -550,20 +547,20 @@ private static function calendar_settings_panel($post)
</th>
<td>
<?php
$fixed = get_post_meta($post->ID, '_calendar_is_static', true);
$fixed = get_post_meta($post->ID, '_calendar_is_static', true);

simcal_print_field([
'type' => 'checkbox',
'name' => '_calendar_is_static',
'id' => '_calendar_is_static',
'tooltip' => __(
'Remove the navigation arrows and fix the calendar view to its initial state.',
'google-calendar-events'
),
'value' => 'yes' == $fixed ? 'yes' : 'no',
'text' => __('Yes (hide navigation arrows)', 'google-calendar-events'),
]);
?>
simcal_print_field([
'type' => 'checkbox',
'name' => '_calendar_is_static',
'id' => '_calendar_is_static',
'tooltip' => __(
'Remove the navigation arrows and fix the calendar view to its initial state.',
'google-calendar-events'
),
'value' => 'yes' == $fixed ? 'yes' : 'no',
'text' => __('Yes (hide navigation arrows)', 'google-calendar-events'),
]);
?>
</td>
</tr>
<tr class="simcal-panel-field">
Expand Down
14 changes: 7 additions & 7 deletions includes/calendars/views/default-calendar-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ class="simcal-nav simcal-current"
<?php echo $this->draw_month(date('n', $calendar->start), date('Y', $calendar->start)); ?>
</table>

<?php
$is_print_calendar = get_post_meta($calendar->id, '_display_print_calendar');
if($is_print_calendar[0] === 'yes'){
echo '<button id="print-calendar-button" class="print-calendar-button">Print Calendar</button>';
}
echo '<div class="simcal-ajax-loader simcal-spinner-top" style="display: none;"><i class="simcal-icon-spinner simcal-icon-spin"></i></div>';
}
<?php
$is_print_calendar = get_post_meta($calendar->id, '_display_print_calendar');
if ($is_print_calendar[0] === 'yes') {
echo '<button id="print-calendar-button" class="print-calendar-button">Print Calendar</button>';
}
echo '<div class="simcal-ajax-loader simcal-spinner-top" style="display: none;"><i class="simcal-icon-spinner simcal-icon-spin"></i></div>';
}
}

/**
Expand Down
10 changes: 8 additions & 2 deletions includes/events/event-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,14 @@ public function process_event_content($match)
case 'if-today':
case 'if-not-today':
$start_dt = $event->start_dt->setTimezone($calendar->timezone);
$startOfDay = $start_dt->copy()->startOfDay()->getTimestamp();
$endOfDay = $start_dt->copy()->endOfDay()->getTimestamp();
$startOfDay = $start_dt
->copy()
->startOfDay()
->getTimestamp();
$endOfDay = $start_dt
->copy()
->endOfDay()
->getTimestamp();

$today = $startOfDay <= $calendar->now && $calendar->now <= $endOfDay;

Expand Down

0 comments on commit 777dacd

Please sign in to comment.