Close

Change date format

Juson
8 years ago
#11889 Quote
Avatar
  • 25
Hello


I want to change date order, from day/month/year to year/month/day.

I've got homepage rich blog date changed by modifying richblog.cshtml, but not blog post page.


<div class="page-body">
        <div class="post-date">
            @Model.CreatedOn.ToString("D")

I think above is the source code of blog post page, but I don't get what this means.

What should I do? Could you help? Thanks.



Regards,

Juson
Juson
8 years ago
#11891 Quote
Avatar
  • 25
And I found something.


Nop.Web\Plugins\SevenSpikes.Nop.Plugins.RichBlog\Views\RichBlog\_RichBlogCategoriesNavigation.cshtml


<div class="block">
    <div class="title">
        <strong>@T("SevenSpikes.RichBlog.Public.Category.Tab.Title")</strong>
    </div>
    <div class="listbox">
        <ul class="list">
            @foreach (var category in Model)
            {
                <li class="category">
                    <a href="@Url.RouteUrl("BlogByCategory", new {SeName = category.SEName })">@category.Name</a> (@category.NumberOfBlogPosts)


The last line should be 


<a href="@Url.RouteUrl("BlogByCategory", new {SeName = category.SEName })">@category.Name (@category.NumberOfBlogPosts)</a>



The number of blog posts is on the next line if it is out of <a> tag.


I'm not used to programming word, but I'm sure you understand.


Thanks.
iliyan.tanev
8 years ago
#11898 Quote
Avatar
  • 347
Hi,

Thank you for the feedback!

It was fixed a month ago. You should update your plugin to the latest version.
Regards,
Iliyan Tanev
Nop-Templates Dev Team
Juson
8 years ago
#11899 Quote
Avatar
  • 25
iliyan.tanev wrote:
Hi,

Thank you for the feedback!

It was fixed a month ago. You should update your plugin to the latest version.



Hi, iliyan.


I'll check it. Thanks.

Could you give me an advice for the first topic?
Deni
8 years ago
#11901 Quote
Avatar
  • Moderator
  • 389
Juson wrote:
Hello


I want to change date order, from day/month/year to year/month/day.

I've got homepage rich blog date changed by modifying richblog.cshtml, but not blog post page.


<div class="page-body">
        <div class="post-date">
            @Model.CreatedOn.ToString("D")

I think above is the source code of blog post page, but I don't get what this means.

What should I do? Could you help? Thanks.



Regards,

Juson


Hi, 

Yes, this is the code showing the date. Just edit the row like this:

@Model.CreatedOn.ToString("yyyy/MM/dd")



I hope this helped !
Best Regards,
Mladen Staykov
Nop-Templates.com
Juson
8 years ago
#11903 Quote
Avatar
  • 25
Deni wrote:
Hello


I want to change date order, from day/month/year to year/month/day.

I've got homepage rich blog date changed by modifying richblog.cshtml, but not blog post page.


<div class="page-body">
        <div class="post-date">
            @Model.CreatedOn.ToString("D")

I think above is the source code of blog post page, but I don't get what this means.

What should I do? Could you help? Thanks.



Regards,

Juson

Hi, 

Yes, this is the code showing the date. Just edit the row like this:

@Model.CreatedOn.ToString("yyyy/MM/dd")



I hope this helped !






I've tried already, but it doesn't work. I don't know which part of code affects to blog post page date.
iliyan.tanev
8 years ago
#11904 Quote
Avatar
  • 347
Hi,

The View that you should be modifying is Views/Blog/BlogPost.cshtml. If the changes are not visible in the public area, after editing this view, maybe you are using a theme that overrides the blog post view. In this case, you should find the view in the theme and do your changes there.

Are you using one of our themes? 
Regards,
Iliyan Tanev
Nop-Templates Dev Team
Juson
8 years ago
#11967 Quote
Avatar
  • 25
iliyan.tanev wrote:
Hi,

The View that you should be modifying is Views/Blog/BlogPost.cshtml. If the changes are not visible in the public area, after editing this view, maybe you are using a theme that overrides the blog post view. In this case, you should find the view in the theme and do your changes there.

Are you using one of our themes? 



Yes. I'm using Brooklyn Theme. At the time I bought it, I couldn't find yyyy/mm/dd for blogpost date format.

I updated to the latest version, I get it. Successfully modified.


Thanks.
cliebich
8 years ago
#12523 Quote
Avatar
  • 8
I am using the Pavilion theme.  Is there any way to backdate a blog post? or is there a way to use the startdate of the post instead of the createdon date?
anton_ivanov
8 years ago
#12529 Quote
Avatar
  • Moderator
  • 277
Hello,

You can backdate a Blog Post on our Nop Rich Blog plugin on version 3.80. You will simply need to edit the Blog Post and set the Start Date.

Note: If you were already using nopCommerce 3.8 please upgrade your plugins to the latest version in order to get this functionality.
Regards,
Anton Ivanov
Nop-Templates.com