Close

Social Feed Plugin - Post Date Display

kvar
6 years ago
#14403 Quote
Avatar
  • 2
On the Social Feed Plugin - is there a setting to change the Post Date display style?
Right now it displays the date as DD/MM/YYYY and I would like for it to display as MM/DD/YYYY.
Is there a setting somewhere I'm missing, or is there a template file I can change?
anton_ivanov
6 years ago
#14404 Quote
Avatar
  • Moderator
  • 277
Hello,

Unfortunately, this cannot be done from the administration of the plugin. You will need to change the code of the Social Feed plugin in order to achieve that.

You need to change the date format seperately for each social network. Please follow the examples below:

Facebook

1. Edit the ~/Plugins/SevenSpikes.Nop.Plugins.SocialFeed/Views/SocialFeedPublic/Shared/_Facebook.cshtml
2. On line 35 you will find the following code:
    
<span class="post-date">@feed.CreatedDate.Value.ToString("dd/MM/yyyy")</span>

3. Change the "dd/MM/yyyy" string that is passed to the ToString() function to "MM/dd/yyyy"

Google+

1. Edit the ~/Plugins/SevenSpikes.Nop.Plugins.SocialFeed/Views/SocialFeedPublic/Shared/_GooglePlus.cshtml
2. On line 33 you will find the following code:
    
<span class="post-date">@feed.PublishedDate.Value.ToString("dd/MM/yyyy")</span>

3. Change the "dd/MM/yyyy" string that is passed to the ToString() function to "MM/dd/yyyy"

Twitter

1. Edit the ~/Plugins/SevenSpikes.Nop.Plugins.SocialFeed/Views/SocialFeedPublic/Shared/_Twitter.cshtml
2. On line 32 you will find the following code:
    
<span class="post-date">@twitterStatus.CreatedAt.Value.ToString("dd/MM/yyyy")</span>

3. Change the "dd/MM/yyyy" string that is passed to the ToString() function to "MM/dd/yyyy"


Hope that helps!
Regards,
Anton Ivanov
Nop-Templates.com
kvar
6 years ago
#14409 Quote
Avatar
  • 2
By the way, that was a simple fix and worked as expected!

Thank you!