Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I followed the instructions found in this video on the Umbraco Learning Base youtube channel: https://www.youtube.com/watch?v=xMS-rtqhWzU&t=220s
I have my blog working, but the date picker is showing the time, I need it to NOT show the time.
I've selected the "Date Picker," not the "Date Picker with Time" but the time is displaying.
Ex: 2/1/2023 12:00:00 AM
This is my code:
@{ var selection = Umbraco.Content(Guid.Parse("8f22dca9-3862-48d7-b22b-b5f064dc4419")) .ChildrenOfType("newsItem") .Where(x => x.IsVisible()) .OrderByDescending(x => x.CreateDate).Take(2); } @foreach (var item in selection) { var thumbnail =item.Value<IPublishedContent>("thumbnailImage"); <div class="col-md-4"> <div class="LNcard-body"> <div class="thumbnail-latest-blog"> <a href="@item.Url()" class="featured-link"><div class="thumbnail-latest-img" style="background-image:url('@thumbnail.Url()')"></div></a> <h5 class="card-title" style="font-weight: bold;">@item.Value("title")</h5> <p class="LNpubmeta"><i>@item.Value("publishedOn")</i></p> <p class="card-text">@item.Value("preview")</p> <a href="@item.Url()" class="btn btn-pelican-secondary" role="button" title="Read More" alt="Read More">Read More</a> </div> </div> </div> }
The publishedOn value is the date picker. Date is configured to show as DD-MM-YYYY
Any suggestions for how to remove the time would be great! Thank you.
You will need to use a date format string e.g.
var publishedDate = item.Value<DateTime>("publishedOn").ToString("dd-MM-yyyy")
Thank you!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to stop the Date Picker from showing time
I followed the instructions found in this video on the Umbraco Learning Base youtube channel: https://www.youtube.com/watch?v=xMS-rtqhWzU&t=220s
I have my blog working, but the date picker is showing the time, I need it to NOT show the time.
I've selected the "Date Picker," not the "Date Picker with Time" but the time is displaying.
Ex: 2/1/2023 12:00:00 AM
This is my code:
The publishedOn value is the date picker. Date is configured to show as DD-MM-YYYY
Any suggestions for how to remove the time would be great! Thank you.
You will need to use a date format string e.g.
Thank you!
is working on a reply...