WordPress.org

Support

Support » Plugins and Hacks » Countdown Timer » [Resolved] [Plugin: Countdown Timer] [patch] On-hover date localization

[Resolved] [Plugin: Countdown Timer] [patch] On-hover date localization

  • Hi,

    We’re using Countdown Timer in non-English installation and the default formatting of on-hover date, which is non-localized with gmdate(), was unsatisfactory.

    Hence a little change in the patch included against 2.4.3.

    Firstly, it makes use of date_i18n() WordPress function instead of gmdate(). This change is backword-compatible, the date format used is the same.

    Secondly, if the format date field in Countdown Timer settings is left blank, the default WordPress format, set on Settings page, is used as “[date], [format]”.

    Please consider merging this patch — probably with fixes to settings instruction to make the behavior clear.

    http://wordpress.org/extend/plugins/countdown-timer/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The patch:

    --- ./fergcorp_countdownTimer.php.orig	2012-03-11 23:08:57.000000000 +0100
    +++ ./fergcorp_countdownTimer.php	2012-04-20 10:11:24.860685509 +0200
    @@ -402,7 +402,10 @@
     			$content = "<li class = 'fergcorp_countdownTimer_event_li'>";
     		$nonceTracker = "x".md5(rand()); //XHTML prevents IDs from starting with a number, so append a 'x' on the front just to make sure it dosn't start with numeric
     		$eventTitle = "<span class = 'fergcorp_countdownTimer_event_title'>".($link==""?$eventText:"<a href="$link">".$eventText."</a>").'</span>'.get_option('fergcorp_countdownTimer_titleSuffix')."\n";
    -		$timePrefix = "<abbr title = \"".gmdate($timeFormat, $time + (get_option('gmt_offset') * 3600))."\" id = '$nonceTracker' class = 'fergcorp_countdownTimer_event_time'>";
    +		if ($timeFormat == "") {
    +			$timeFormat = get_option('date_format') . ", " . get_option('time_format');
    +		}
    +		$timePrefix = "<abbr title = \"".date_i18n($timeFormat, $time + (get_option('gmt_offset') * 3600))."\" id = '$nonceTracker' class = 'fergcorp_countdownTimer_event_time'>";
    
     		if(($time_left < 0)&&($timeSince==1)&&((($time_left + $timeSinceTime) > 0)||($timeSinceTime == 0))){ //If the event has already passed and we still want to display the event
     			$fergcorp_countdownTimer_noEventsPresent = FALSE; //Set to FALSE so we know there's an event to display
    Plugin Author fergbrain

    @fergbrain

    Cool, thanks. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Countdown Timer] [patch] On-hover date localization’ is closed to new replies.
Skip to toolbar