When I create the event I pick 18:00 then when I view the event I created it shows 17:00 ....

but I can go back to edit and on that screen it shows 18:00 really weird

CommentFileSizeAuthor
#5 event.module.52481.patch457 bytesbenthere
event.png14.76 KBjoemoraca
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joemoraca’s picture

It works OK if I use 24hr time format just 12 hr format displays off one hour

seanr’s picture

Priority: Normal » Critical

Same here. Sounds like someone screwed up some math. Marking as critical since it basically breaks event (and many people are not used to 24hr format)

nydrupalfan’s picture

Darn, I am encountering the exact same bug. The listed times are off by one hour from what was input into the node form. There must be something wrong with the timezone conversions. Does anyone have a quick fix for this?

nydrupalfan’s picture

Event.module version 1.188 shows the correct time on the editing form in 12 hour format. I think the changes to the form in 1.189 might have introduced the bug.

benthere’s picture

FileSize
457 bytes

This is still present in event.module,v 1.192 and is definitely critical.

I've put together a patch that puts back in a small portion of code that was replaced between 1.188 and 1.189.

I believe the problem is that 12h time needs to store 0 for hour 1, while 24h time stores 0 for hour 0 and so on. The patch should be improved, but seems to work for now.

benthere’s picture

Status: Active » Needs work
benthere’s picture

Actually I don't know how the hour should be stored. What I said up 2 posts is wrong I think. But the patch of code that I copied out of 1.188 worked. I just don't know why it worked. Please take a look at the patch and clean it up if necessary.

seanbfuller’s picture

I can confirm that this fix works. The problem is that range(1, 12) gives you back an array where the label "1" is in position "0". For example:

<select name="edit[start_hour]"  id="edit-start_hour" >
  <option value="0">1</option>
  <option value="1">2</option>
  <option value="2" selected="selected">3</option>
  <option value="3">4</option>
  <option value="4">5</option>
  .
  .
  .
killes@www.drop.org’s picture

Status: Needs work » Fixed

applied better patch

Anonymous’s picture

Status: Fixed » Closed (fixed)