The part that I am struggling to achieve is to convert the Object Date, into a string to give something "readable" that can be displayed. At the moment it returns 3/23/2013 12:00:00 AM. To achieve the GroupBy, I have had to use the static, but, would either would like to achieve dynamically, or convert the returned object, Date to a DateTime string. Have tried dynamically but coudn't use GroupBy, so from the static, I can use either the Key, or the property Date. Tried to convert it in C# but it would appear that the Umbraco Long date is a different form to MVC Long date.
It seems like the hard part was done but have been stuck on this for a day - if anyone could add something to achieve a date time format from what I have or achieve another way, it would be very much appreciated.
however i am writing this on my phone as a combination of sql server and webmatrix 3 killwd my machine stone dead.
i may be able to get he answer via the phone, but before i go looking, was it a group by as above using key that you need, or is it.just a striaght date format?
Sorry to ask to be specific, but am a bit.limited but will help all i can
V6 GroupBy and DateTime Format
Hi, need some help finishing this off, if possible.
This is what I have, it groups under a date then by create date, both descending. This part is fine and returns as required.
@{ var root = Model.Content.AncestorOrSelf();
var top = root.Descendants("dailyspecials").OrderBy("Date desc").GroupBy("Date");
}
@foreach (var groupDate in top)
{ @groupDate.Key
Did you get anywhere with the date formatting?
hi
i did get this working, so the answer is yes.
however i am writing this on my phone as a combination of sql server and webmatrix 3 killwd my machine stone dead.
i may be able to get he answer via the phone, but before i go looking, was it a group by as above using key that you need, or is it.just a striaght date format?
Sorry to ask to be specific, but am a bit.limited but will help all i can
regards
g
is working on a reply...