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

  1. Arkantos
    Posted 3 years 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.


  2. Boštjan Cigan
    Plugin Author

    Posted 3 years 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.


  3. Arkantos
    Posted 3 years 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
    Posted 3 years 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
    Plugin Author

    Posted 3 years 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.


  6. Arkantos
    Posted 3 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Twitget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic