Orchard DateTime Stamps

Topics: Customizing Orchard, Localization
Aug 2, 2011 at 10:47 AM

Hi,

i ran into another problem. I want to change the DateTime Stamps. I found a couple of threads about it here, but none really helped me.

http://orchard.codeplex.com/discussions/260455 - i can't find the shapes.cs, nor would i know how to define a different templetate in a costum PublishedState.cshtml

What i want to do is change"Jul 21 2011 10:56" to "Thursday, 21.7.2001", so it shows the german date without a time.

Can anyone point me to a tutorial on how to do this ? my good friend google hid all the good things from me so far :/

 

Thanks

Coordinator
Aug 3, 2011 at 12:23 AM

The template you want to override is Parts.Common.Metadata.Summary.cshtml or Parts.Common.Metadata.cshtml.

Aug 3, 2011 at 6:16 AM

yeah i found that part. but changing it from utc to gmt didnt do it, so how would i reformat it ?

Coordinator
Aug 4, 2011 at 12:34 AM

Did you try doing a ToString with an explicit format string?

Aug 4, 2011 at 8:17 AM

that helped.

http://orchard.codeplex.com/discussions/251800, found that which resulted in this:

 

@{ var TimeStamp = Model.ContentPart.PublishedUtc.Date; }
<div class="published">
        <h6>@TimeStamp.ToString("dddd, dd.MM.yyyy")</h6>
</div>

Renders it to that: Dienstag,02.08.2011

Thank you very much.

Oct 25, 2012 at 11:13 AM
bertrandleroy wrote:

The template you want to override is Parts.Common.Metadata.Summary.cshtml or Parts.Common.Metadata.cshtml.

 

I am very new to orchard and am unclear when you mean 'override'.  Could you explain a bit further?  Maybe show a sample of what to do?

Also, if I installed a new theme, would it possibly have a 'overridden' template?

Thanks.

Coordinator
Oct 26, 2012 at 3:19 AM

Make a copy into the views folder of your theme. See http://docs.orchardproject.net/Documentation/Customizing-the-default-theme and pretty much the whole "Creating Themes" section from http://docs.orchardproject.net/