Plugin Directory

Changeset 3669018


Ignore:
Timestamp:
08/27/2026 02:09:08 PM (2 months ago)
Author:
manjilshre
Message:

Fix ago date timezone

Location:
nepali-bs-date-tools
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • nepali-bs-date-tools/tags/1.0.0/nepali-bs-date-tools.php

    r3595159 r3669018  
    5858   
    5959    global $NBSD_Dateplugin;
    60     return $NBSD_Dateplugin->NBSD_convertTonepalinumber(human_time_diff( get_the_time('U', $post),current_time('timestamp')) . ' ago');   
     60    $timestamp = get_post_timestamp($post);
     61    return $NBSD_Dateplugin->NBSD_convertTonepalinumber(human_time_diff( $timestamp,current_time('timestamp')) . ' ago');   
    6162}
    6263
    … …  
    152153    if ( is_admin() ) return $date;
    153154
     155    if (!$post instanceof WP_Post) return $date;
     156
    154157    if ( get_post_type($post) !== 'post' ) return $date;
    155158
  • nepali-bs-date-tools/trunk/nepali-bs-date-tools.php

    r3595159 r3669018  
    44 * Plugin URI:  https://wordpress.org/plugins/nepali-bs-date-tools
    55 * Description: Nepali BS Date Tools plugin converts post date into Nepali Bikram Sambat (BS) dates automatically.It displays today date in Nepali BS date and converts Ad to BS and BS to AD dates.
    6  * Version:     1.0.0
     6 * Version:     1.0.1
    77 * Author:      Manjil Shrestha 
    88 * License:     GPLv2 or later
    … …  
    5858   
    5959    global $NBSD_Dateplugin;
    60     return $NBSD_Dateplugin->NBSD_convertTonepalinumber(human_time_diff( get_the_time('U', $post),current_time('timestamp')) . ' ago');   
     60    $timestamp = get_post_timestamp($post);
     61    return $NBSD_Dateplugin->NBSD_convertTonepalinumber(human_time_diff( $timestamp,current_time('timestamp')) . ' ago');   
    6162}
    6263
    … …  
    152153    if ( is_admin() ) return $date;
    153154
     155    if (!$post instanceof WP_Post) return $date;
     156
    154157    if ( get_post_type($post) !== 'post' ) return $date;
    155158
Note: See TracChangeset for help on using the changeset viewer.