0

Did anyone ever do this, I have different time fields in admin form, all works fine (attributes, save etc...) except the edit, I can't retrieve the time value. On saving, the value is well saved, In grid I get also the saved value, but when I click on that row to edit, I'm getting 00:00:00 on each time field.

enter image description here

Form.php

$timeFormatIso = Mage::app()->getLocale()->getTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG); //HH:mm:ss
$fieldset->addField('monday_start', 'time', array(
    'label'                 => Mage::helper('ticket')->__('Start'),
    'class'                 => 'required-entry',
    'required'              => true,
    'name'                  => 'monday_start',
    'value'                 => $ticket->getMondayStart(),
    'input_format'          => Varien_Date::DATE_INTERNAL_FORMAT,
    'style'                 => 'width: 80px',
    'format'                => $timeFormatIso,
));
  • The attribute type in database : TIME

  • Format: 14:00:00

  • $ticket->getMondayStart() return well : 14:00:00

I also tried to get $ticket->getMondayStart() as an array but it no way.

$ticket->getMondayStart() = 
Array
(
    [0] => 14
    [1] => 00
    [2] => 10
)

Your Answer

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

Browse other questions tagged or ask your own question.