Copied to clipboard

Flag this post as spam?

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


  • William Corry 34 posts 171 karma points
    Oct 24, 2014 @ 15:03
    William Corry
    0

    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?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Oct 25, 2014 @ 11:06
    Dan Diplo
    101

    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.

  • William Corry 34 posts 171 karma points
    Oct 25, 2014 @ 11:52
    William Corry
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft