Skip to content
This repository has been archived by the owner on Oct 4, 2017. It is now read-only.

Date #6

Merged
merged 3 commits into from
Feb 14, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions includes/templating.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function i18n_init() {
$this->future_signifier = __( ' (Anticipated)', 'wp-resume' );

if ( defined('QTRANS_INIT') || $this->parent->api->apply_filters( 'translate_date', false ) )
add_filter( 'resume_date', array( &$this, 'translate_date' ), 10, 4 );
add_filter( 'resume_date', array( &$this, 'translate_date' ), 10, 2 );

}

Expand Down Expand Up @@ -198,7 +198,7 @@ function get_date( $ID ) {
continue;

$date .= '<span class="' . $class . '" title="' . date( 'Y-m-d', strtotime( $value ) ) . '">';
$date .= $this->parent->api->apply_filters( 'date', $value, $field );
$date .= apply_filters( 'resume_date', $value, $field );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should in theory be equivalent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, they should... but the new one works, while the old one does not :(

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just kidding. Found the mistake.

$date .= '</span>';

//this is the from field and there is a to field, append the dash
Expand Down Expand Up @@ -239,7 +239,7 @@ function translate_date( $date, $type ) {
return $date;

//i18n date
$date = date_i18n( $date_format, strtotime( $from ) );
$date = date_i18n( $date_format, strtotime( $date ) );

//we don't do anything else to start dates, so kick
if ( $type == 'from' )
Expand All @@ -251,11 +251,12 @@ function translate_date( $date, $type ) {

//append e.g, ' (Anticipated)' to future dates
//note: this string won't appear in .POT files, but should still hit qTranslate when run (I hope)
$date .= __( $this->parent->api->filters( 'future_signifier', $this->future_signifier ) );
// TODO: Fix this since right now it does return a Fatal Error
//$date .= __( $this->parent->api->filters( 'future_signifier', $this->future_signifier ) );

return $date;

}


}
}