I'm creating a listing of nodes that contain tour data. The issue I ran into when uploading is that the date format in the provided excel docs wouldn't upload correctly to the datepicker property type so we dumped the date data into a textfield properties instead. I now need to list my nodes by date, and I don't know how to do that converting the properties from strings to dates.
var tours = Model.NodeById(-1).Descendants("tour");
the properties on the node for the dates are this startDate & endDate
I need to get all tours that have a endDate that is equal or greater than todays date, I then need to order them by startDate asc. I have no idea how to write the query for this. I'm contemplating adding datePicker properties and then manually updating the nodes, that should make it easier, any opinions on that?
Where Statement Help Needed
I'm creating a listing of nodes that contain tour data. The issue I ran into when uploading is that the date format in the provided excel docs wouldn't upload correctly to the datepicker property type so we dumped the date data into a textfield properties instead. I now need to list my nodes by date, and I don't know how to do that converting the properties from strings to dates.
var tours = Model.NodeById(-1).Descendants("tour");
the properties on the node for the dates are this
startDate
&endDate
I need to get all tours that have a endDate that is equal or greater than todays date, I then need to order them by startDate asc. I have no idea how to write the query for this. I'm contemplating adding datePicker properties and then manually updating the nodes, that should make it easier, any opinions on that?
Thanks for reading!
Hi Chuck,
Using DynamicNode in a Legacy Razor Macro, something like this:
But are you fixed to using a legacy Razor Macro? This would be better using the recommended Partial View Macro (Umbraco v4.10+)
Jeavon
I'm more than happy to switch this to a partial view macro... how would it benefit me here?
Ok, did you you try the above snippet?
It would be like this in a Partial View Macro:
However I very good reason is that Descendants() has much better performance in a Partial View Macro, well everything does but especially that!
is working on a reply...