get_weekday_initial( date_i18n( 'l', $t, true ) ); } list( $month, $year, $month_name, $weekday ) = explode( ',', date_i18n( 'm, Y, F, w', $first_of_month ) ); $weekday = ( $weekday + 7 - $first_day ) % 7; #adjust for $first_day $title = esc_html( $month_name ) . ' ' . $year; #note that some locales don't capitalize month and day names #Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 list( $p, $pl ) = each( $pn ); list( $n, $nl ) = each( $pn ); #previous and next links, if applicable if ( $p ) $p = '' . ( ( $pl ) ? ( '' . $p . '' ) : $p ) . ' '; if ( $n ) $n = ' ' . ( ( $nl ) ? ( '' . $n . '' ) : $n ) . ''; $calendar = '' . "\n" . '\n"; if ( $day_name_length ) { #if the day names should be shown ($day_name_length > 0) #if day_name_length is >3, the full name of the day will be printed foreach ( $day_names as $d ) { $calendar .= ''; } $calendar .= "\n"; } $time_now = current_time( 'timestamp' ); $today = mktime( 0, 0, 0, date( 'm', $time_now ), date( 'd', $time_now ), date( 'Y', $time_now ) ); if ( $weekday > 0 ) $calendar .= ''; #initial 'empty' days for ( $day = 1, $days_in_month = date( 't', $first_of_month ); $day <= $days_in_month; $day++, $weekday++ ) { if ( 7 == $weekday ) { $weekday = 0; #start a new week $calendar .= "\n"; } $timestamp = mktime( 0, 0, 0, $month, $day, $year ); if ( isset( $days[$timestamp] ) && is_array( $days[$timestamp] ) ) { list( $link, $classes, $content ) = $days[$timestamp]; $calendar .= '' ) : '>' ) . ( ( $link ) ? ( '' . $day . '' . $content ) : '' . $day . '' . $content ) . ''; }else{ $css_class = ( $timestamp < $time_now ) ? 'gce-day-past' : 'gce-day-future'; $calendar .= ''; } } if ( 7 != $weekday ) $calendar .= ''; #remaining "empty" days return $calendar . "\n
' . $p . '' . ( ( $month_href ) ? ( '' . $title . '' ) : $title ) . '' . $n . "
' . esc_html( $d['initial'] ) . '
 
' . $day . ' 
\n"; } ?>