Calendar displaying 'empty' times

During development of a calendar recently, I struck some odd behaviour with how some events are displayed.


The calendar displays Single Calendar Events both with, and without times specified. Those without times are either all day events, or events where times are 'TBA'.



The client in this case was quite particular about how they wanted times to display, so I had used a mixture of keywords to construct the time component.

Wierdly, when there was no time specified, Matrix displayed a strange 'default' time of 12am - 9:59am. Clearly wrong.



I can understand the 12am in the context of an all day event - it's vaguely logical, but where is this 9:59am coming from? In any case, no time was specified, no time should display… Matrix should not be putting in some arbitrary value.



The keywords that display this are: %event_start_time_12h% %event_start_time_24h% %event_short_start_time% and any of the %event_start_datetime_% keywords that use the PHP time format.



Am I doing something wrong? and if not, is this a bug? We're still on 3.20.6, is it perhaps something that is already fixed?

No, this is a known issue. I posted this a bug years ago as it was very frustrating when I found it. Squiz said it wasn't a bug, so it was never fixed. So, I have resorted to just using the full date keyword, then using js I check for --:–:-- which means no time, then remove that entry. It is a pain, but it is what I have had to do to get it working.


The only keyword that works how you want is: %event_start_datetime%

I believe issues were addressed with calendar date keywords for a similar problem:


#4389



Could be the same issue, the version numbers are higher than what you are on currently (not marked as completed though).



(Just to clarify, this was marked as a feature)


Hmm - thanks for that Nic.

Not a bug eh? So, perhaps someone at Squiz can explain how 9:59am is correct, or expected behaviour.

Edit: ahh - thanks Anthony. Your post and this one crossed paths. Seems I can look forward to some possible improvement with our impending upgrade. Fingers crossed!

[quote]
I believe issues were addressed with calendar date keywords for a similar problem:



#4389



Could be the same issue, the version numbers are higher than what you are on currently (not marked as completed though).



(Just to clarify, this was marked as a feature)

[/quote]



Yeah, that is a duplicate of my bug #2577. To my knowledge it was never fixed. Am I wrong?

I'm not seeing it marked in the bug tracker, but I'll seek some confirmation from a developer. It doesn't look like it has. Displaying a time of 9:59 is different to what is described in those tickets. When a time isn't selected the value 00:00:00 is being stored (aka midnight), so 12am is 'valid'.


We'll get a second pair of eyes on it, but it might help to post some of the sample dates you are displaying so we can try and replicate it on a more recent system if needed.

[quote]
I'm not seeing it marked in the bug tracker, but I'll seek some confirmation from a developer. It doesn't look like it has. Displaying a time of 9:59 is different to what is described in those tickets. When a time isn't selected the value 00:00:00 is being stored (aka midnight), so 12am is 'valid'.



We'll get a second pair of eyes on it, but it might help to post some of the sample dates you are displaying so we can try and replicate it on a more recent system if needed.

[/quote]



The suggested patch on Bug #4389 (marked as a Feature) has not been committed to our CVS.

I will change the status to a bug, review the patch and commit it. I doubt it will be ready by upcoming release but I will post the public CVS links.


Um, there's not really any 'sample date' as such. It occurred with any Single Calendar Event where no time was specified.
An example is this page: http://go.unimelb.edu.au/o3r
Now that I am using %event_datetime_summary%, it is displaying correctly, with date only, but when I was using %event_short_end_time% as part of a string of keywords, it displayed 9:59am as the end time.

I would expect an event with no defined time to not display a time at all, in line with the iCal standard, eg: DTSTART;VALUE=DATE:20110330
If I had asked, specifically for a time to display when none was specified (as I did), I would expect the returned value to be either empty, or something 'null' like --:--, not an arbitrary number generated by the system.

At the moment, I don't believe Matrix is behaving in a consistent or logical manner - some keywords do it and others don't. I'd certainly appreciate the problem being followed up, but in the short term, at least I know I'm not missing anything and I'm not the only one seeing the problem.

Thanks for your replies.

There also has been a recent patch to take care of some ICAL situations.
http://bugs.matrix.squiz.net/view_bug.php?bug_id=4073



I will have to merge this fix with the suggested patch in http://bugs.matrix.squiz.net/view_bug.php?bug_id=4389

Fix is now available for Bug 4389 Calendar event start_time keyword returns 12am for non-timed events.


Public CVS link Bug 4389.