Trying out wp

This blog should track development items.  Updates to main project, updates to side projects, learning, etc.  As a starter, an old trick.

From December, 2014:
Calendar Bug
On the events calendar feature, clients noticed a new bug when we updated servers earlier this year.  If time in hours == 12 and anything other than 00 minutes, the time resets to 6:59PM (wasn’t happening with AM).  The issue was with anything over 24 on the hour scale (which is how 12pm is represented in the db).

The old method was, if time was over 24 (i.e.: 12:04pm became 24:04pm) to switch full time string (24:00:00) to valid string (12:00:00).  For some reason, this worked with the old, wonky server setup, but (rightly) didn’t now, as going over 24 hours in a cycle doesn’t make much sense.  Switched to select only first 2 numbers of event_time and switch from 24 to 12:

if (substr($event['event_time'], 0, 2) == "24") {
$event['event_time'][0] = "1";
$event['event_time'][1] = "2";

A simple fix- the harder issue was finding the problem!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s