WordPress.org

Ready to get started?Download WordPress

Forums

Twitget
[resolved] Displaying wrong day if use 'j' (6 posts)

  1. Arkantos
    Member
    Posted 9 months ago #

    Twitget and WordPress version: Latest for both
    Your settings, and what you have selected: date format Y/m/d \a\t g:i A

    The widget is displaying the wrong day if you change the day format from jS to just j. Please, fix it.

    http://wordpress.org/extend/plugins/twitget/

  2. Boštjan Cigan
    Member
    Plugin Author

    Posted 9 months ago #

    Which date format were you using?

    When you pasted the date format here there is no jS there. Please paste the whole format that "screwed" the date up, so that I can debug it more easily.

    Cheers.

  3. Arkantos
    Member
    Posted 9 months ago #

    Ok, the date format I want to use is: F j, Y g:i a

    ... where "j" is showing the wrong day number.

  4. scuddr
    Member
    Posted 8 months ago #

    I'm running into the same problem in version 3.0. I dug into the twitget/twitget.php file in the plugin and found this part of the code:

    // The array for converting PHP formatted date to moment.js date
    global $twitget_time_array;
    $twitget_time_array = array(
    	"d" => "MM", // 01 - 31 day of the month
    	"D" => "ddd", // Mon through Sun
    	"j" => "M", // 1 to 31 day of the month without zeroes

    If you look at the moment.js documentation, however, those conversions are incorrect. The day tokens are actually getting replaced with month tokens. In that snippet of code above, "d" should really go to "DD" and "j" should really go to "D" in order to convert the values properly.

  5. Boštjan Cigan
    Member
    Plugin Author

    Posted 8 months ago #

    Thank you!

    I've been really busy lately with my work, so I haven't had the time yet to resolve some support threads.

    Marking as resolved, I'll commit it when I resolve the other threads as well.

    Again thanks.

    Cheers.

  6. Arkantos
    Member
    Posted 8 months ago #

    Thank you very much, scuddr! That fixed it. Now is showing the correct day number instead of the month number.

    No problem Boštjan, awesome plugin anyway ;) Just include this fix in the next version.

Reply

You must log in to post.

About this Plugin

About this Topic