Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Tregoning 63 posts 236 karma points
    Jan 19, 2015 @ 15:11
    David Tregoning
    0

    Simple date formatting

    I have the following code on one of my pages and it works fine

    @foreach (var item in menuItems){
            var tempMonth = item.GetProperty("eventDateStart").Value;               
            <div class="event-single">
                    <a href="@item.Url">@string.Format("{0:dd MMM yyyy}", @tempMonth)</a>
            </div> 
    }
    

    On another page I am using Concat to combine to selections into my menuItems and when I use the same code (minus the .Value) the resulting is displayed:

    Umbraco.Core.Dynamics.PropertyResult

    If I just use @tempMonth within my <a> tags I get a dd/mm/yyyy hh:mm:ss result.

    Can anybody guide me as to what the correct code should be?

  • David Tregoning 63 posts 236 karma points
    Jan 19, 2015 @ 15:16
    David Tregoning
    100

    Solved this so please ignore - delete function did not work

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies