Skip to content

Commit

Permalink
Fixed a couple of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
pippinsplugins committed Jul 11, 2013
1 parent 5e4b11b commit 4502312
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 11 deletions.
6 changes: 5 additions & 1 deletion assets/js/sc-ajax.js
Expand Up @@ -2,7 +2,11 @@ jQuery(document).ready(function($) {
$('body').on('submit', '.sc_events_form', function() {

document.body.style.cursor = 'wait';
var calendar = $(this).parent().parent().parent().parent().attr('id');
if( $(this).attr('id') == 'sc_event_select' ) {
var calendar = $(this).parent().parent().parent().attr('id');
} else {
var calendar = $(this).parent().parent().parent().parent().attr('id');
}
var data = $(this).serialize();
$.post(sc_vars.ajaxurl, data, function (response) {
$('#' + calendar).html(response);
Expand Down
8 changes: 4 additions & 4 deletions includes/calendar.php
Expand Up @@ -20,10 +20,10 @@ function sc_get_events_calendar( $year_override = null ) {
$today_year = date('Y', $time);

// check for posted month/year
if( isset( $_POST['sc_nonce'] ) && wp_verify_nonce( $_POST['sc_nonce'], 'sc_calendar_nonce' ) ) {
$today_month = absint( $_POST['sc_month'] );
$today_year = absint( $_POST['sc_year'] );
$current_month = absint( $_POST['sc_current_month'] );
if(isset($_POST['sc_nonce']) && wp_verify_nonce($_POST['sc_nonce'], 'sc_calendar_nonce')) {
$today_month = isset( $_POST['sc_month'] ) ? absint( $_POST['sc_month'] ) : date( 'n' );
$today_year = isset( $_POST['sc_year'] ) ? absint( $_POST['sc_year'] ) : date( 'Y' );
$current_month = isset( $_POST['sc_current_month'] ) ? absint( $_POST['sc_current_month'] ) : date( 'n' );
if( isset( $_POST['sc_prev'] ) ) {
$today_year = $current_month == 1 ? $today_year - 1 : $today_year;
} elseif( isset( $_POST['sc_next'] ) ) {
Expand Down
8 changes: 4 additions & 4 deletions includes/meta-boxes.php
Expand Up @@ -142,10 +142,10 @@ function sc_meta_box_save($post_id) {
$end_am_pm = sanitize_text_field( $_POST['sc_event_end_time_am_pm']);
$recurring = isset($_POST['sc_event_recurring']) ? $_POST['sc_event_recurring'] : '';

if( $am_pm == 'pm' && $hours < 12 )
$hours += 12;
elseif( $am_pm == 'am' && $hours >= 12 )
$hours -= 12;
if( $am_pm == 'pm' && $hour < 12 )
$hour += 12;
elseif( $am_pm == 'am' && $hour >= 12 )
$hour -= 12;

$day = date( 'd', strtotime( $date ) );
$month = date( 'm', strtotime( $date ) );
Expand Down
Binary file added languages/pippin_sc-pl_PL.mo
Binary file not shown.

0 comments on commit 4502312

Please sign in to comment.