I am creating an event calendar, and would like to display the date of
the event.
Some events take place on only one day, while some take place over
multiple days.

I would like only one date to display for single day events, and for
multiday events, I would like to display both the start date of the
event and the end date.

I have tried using the following statement in my template:
<h3>Date:{{Event.start_DateTime|date:"l N j" }}{%ifnotequal
Event.start_DateTime|date Event.end_DateTime|date %}  -
{{Event.end_DateTime|date:"l N j" }}{% endifnotequal %}</h3>

where start_DateTime and end_DateTime are both DateTimeFields.

Now, when I test it, I get some strange behavior.

With "ifnotequal" and the |date filter,
--both the multiday and singleday events only display one day.

with "ifequal" and the |date filter
--both multiday and singleday events display two days (start and end)

with ifnotequal and no date filter
--both multiday and single day events display two days

with ifequal and no date filter
--both multiday and singleday events display one day



questions:
why is there uniformity? Why do both act in concert?

What effect does the |date filter have? (I originally used it because
i figured that the two DateTime objects wouldn't have the same Time,
and so would evaluate to not being equal)

Is there any way to get this working the way I envision it?

Thanks for your time and patience.

ryan vanasse



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to