1

I am using jQuery-timepicker to give the user an option to pick a starting time and ending time.

My init looks like this:

$('.timepicker').timepicker({
    scrollDefault: 'now'
});

When I save the entry as attached (screen below) it is displaying the time + 6 minutes. enter image description hereenter image description here

My template looks like this:

<input type="text" name="fields[myTimes][{{ block.id }}][fields][startDateTime][date]" class="form-control datepicker" value="{{ block.startDateTime|date('m/d/Y') }}">

<input type="text" name="fields[myTimes][{{ block.id }}][fields][startDateTime][time]" class="form-control timepicker" value="{{ block.startDateTime|date('h:m') }}">

<input type="text" name="fields[myTimes][{{ block.id }}][fields][endDateTime][time]" class="form-control timepicker" value="{{ block.endDateTime|date('h:m') }}">

When I save my form, everything looks like it is saving correctly, its always +6 min. I'm not sure what I am doing wrong.

Thank you for any suggestions!

EDIT

Here is another example. I have saved for 9:00PM - 10:00PM It saves correctly, but the template shows +6 still. :)enter image description hereenter image description hereenter image description here

  • How fascinating. Is your system clock off by 6 minutes? (Wild guess.) Wondering if this happens in more than one environment... – Matt Stein Jun 3 '17 at 19:52
  • Strange huh? It doesn't appear that it's the clock. It's almost like it's at the template level - which is why I thought for sure it's something i'm doing (or not doing). – Damon Jun 4 '17 at 2:30
  • Yeah... that's super weird. No idea why that would happen, but definitely something xDebug would help figure out. – Brad Bell Jun 4 '17 at 3:34
  • Not to be a broken record, but are you definitely seeing this in more than one environment? I assume you would've mentioned if you were seeing six-minute page load times. – Matt Stein Jun 4 '17 at 3:43
  • Start time seems to get converted to AM, so there might be some formatting involved. – megatrond Jun 4 '17 at 7:17
1

Thank you everyone for your suggestions - I need to keep reading/digging more to fully understand, but it seems that it was just a formatting issue.

{{ block.startDateTime|date('H:i:s') }}

Renders the correct time on the template.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.