More in this section

Forums / Developing with Sitefinity / Issue with Telerik.Events IEvent members

Issue with Telerik.Events IEvent members

2 posts, 0 answered
  1. ddblee
    ddblee avatar
    20 posts
    24 Jul 2008
    19 Feb 2009
    Link to this post
    We're having to write custom code to display items entered into the Events module in Sitefinity and have them display or not display according to their publication and expiration dates.

    We have ended up writing code like this:

    string providerName = "Events"
    EventsManager eventsManager = new Telerik.Events.EventsManager(providerName); 
    string publicationDateField = EventsManager.ContentSettings[providerName].PublicationDateField; 
    string expirationDateField = EventsManager.ContentSettings[providerName].ExpirationDateField; 
    DateTime pubDate = (DateTime)evnt.ContentItem.GetMetaData(publicationDateField); 
    DateTime expireDate = (DateTime)evnt.ContentItem.GetMetaData(expirationDateField); 

    This was more complicated than it should have been. We can access an event's starting date by simply writing
    DateTime endDate = evnt.End; 

    Seems to me the Publication and Expiration dates should be similarly exposed as properties, regardless if they are housed in the sf_GCMetaData table in the database:
    DateTime pubDate = evnt.Pub; 
    DateTime expireDate = evnt.Expire; 

    Is this a change Telerik can do soon?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    19 Feb 2009
    Link to this post
    Hello ddblee,

    I agree with what you say and some task became complicated. This is the reason why we will extend the API for 4.0 and it will be more flexible. Just to let you know the metafields you have specified will be available as properties form 4.0.

    Let us know if there is anything else that we can do for you.

    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered