Copied to clipboard

Flag this post as spam?

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


  • Arie 224 posts 675 karma points
    Aug 12, 2014 @ 08:10
    Arie
    0

    Possible bug: exception if non-existent value is requested

    When I include "endDate" in my output I run into an exception. Since not all of my events have an end date/time, is is possible that the project doesn't handle this situation?

    I can check for the existence of "endDate" in my own code, but I figured that it would be better if it were handled by the project.

  • Ole Martin Bakke 112 posts 624 karma points
    Aug 12, 2014 @ 10:36
    Ole Martin Bakke
    100

    The endDate is a nullable value. That's because its not always you want to show an end date and you could also have a never-ending recurring event. If is't not allowed with empty endDate you can not have this unless you set a specified endDate in a distant future and check for that date when you print.

    For now I think its just as easy to use (ce.endDate.HasValue ? ce.endDate.Value.ToString("dd.MM.yyyy") : "") while showing the event, rather than check if endDate is set to a specific date in distant future.

    This is my point of view, but feel free to share your thoughts and suggestions for changing this and I might reconsider. :)

  • Arie 224 posts 675 karma points
    Aug 13, 2014 @ 06:19
    Arie
    0

    That's exactly what I was going to do :-)

    However, it would still make sense to me to ensure that the KS.Calendar module would handle the condition. That way an integrator wouldn't run into an unpleasant surprise if he or she merely dropped the project into an install without considering the whether some values might be nullable.

    Since the project is more or less a black (gray?) box that stands on its own, it would be good if it handled those situations.

Please Sign in or register to post replies

Write your reply to:

Draft