- This topic has 2 replies, 2 voices, and was last updated 12 years, 8 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › Date and time – conditional – help needed
Tagged: conditional tags, Date, time
Hi,
I need some help with dates and time on single event sites.
I read about conditional tags (http://www.e-dynamics.be/wordpress/?cat=24) and the support forum (http://www.e-dynamics.be/bbpress/) but I just couldn’t find a solution for my project.
I have different events. Sometimes there are one day events like holiday, that don’t have start and end time. Sometimes there are one day events that have start time, but don’t have end time. And sometimes there are events that last a few days. So I want a format that always shows start date, all other variables are conditionally.
This is my logic:
Start time – show if not empty (if I delete start time, after saving I see 00:00)
End date – show if different as start date
End time – show if not empty
I tried different things, but I couldn’t find the real combination. This is my last version:
Start: #d. #m. #Y [events_if tag="#ESCH:#ESCi}" notvalue="00:00"] –
#H:#i [/events_if]
End: [events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"] #@_{-
d. m. Y} [/events_if] [events_if tag="#ESC@H:#ESC@i"
value="#ESC@H:#ESC@i"] – #@H:#@i [/events_if]
Would someone be so kind to help me get this done, please.
For start: you have a “}” in there that shouldn’t be
For end time: also compare to “00:00”
So it becomes:
Start: #d. #m. #Y [events_if tag="#ESCH:#ESCi" notvalue="00:00"] -#H:#i [/events_if]
End: [events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"] #@_{-d. m. Y} [/events_if] [events_if tag="#ESC@H:#ESC@i" notvalue="00:00"] - #@H:#@i [/events_if]
But, to be even better, I’d use this:
Start: #d. #m. #Y [events_if tag="#ESCH:#ESCi" notvalue="00:00"] -
#H:#i [/events_if]
[events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"] End: #@_{- d. m. Y} [events_if2 tag="#ESC@H:#ESC@i" notvalue="00:00"] - #@H:#@i [/events_if2][/events_if]
Btw: make sure there’s no linebreak in the middle of e.g. #@_{- d. m. Y} , in the resulting page it would seem like it wasn’t being replaced, but linebreaks are not ok in it.
Thanks, that works perfectly!