The date picker basically just stores a start date and an end date on any document type it is used on. You can the access the date range "object" from your code like so:
var dateRange = Model.Content.GetPropertyValue<Diplo.DateRangePicker.DateRange>
DateTime start = dateRange.StartDate;
DateTime end = dateRange.EndDate
So, in theory you could write code that just displays something by checking that the current date (Date.Now.Date) falls between the start and end date.
Alternatively you could also probably use Umbraco's built in scheduled publish to only publish a page between a given start and end date. You'll find this feaure on the Properties tab.
Lol never even thought about (or looked at) the schedule unpublish part
Although we are looking to have featured offers section once the time period expired it will fall into the normal offers but at least it gives me a starting point thanks.
Could this be used to display events
Could I use the date picker to run offers ie offer is valid from x-y and it will only show between those dates?
The date picker basically just stores a start date and an end date on any document type it is used on. You can the access the date range "object" from your code like so:
So, in theory you could write code that just displays something by checking that the current date (Date.Now.Date) falls between the start and end date.
Alternatively you could also probably use Umbraco's built in scheduled publish to only publish a page between a given start and end date. You'll find this feaure on the Properties tab.
Lol never even thought about (or looked at) the schedule unpublish part
Although we are looking to have featured offers section once the time period expired it will fall into the normal offers but at least it gives me a starting point thanks.
is working on a reply...