0

Currently, time for Holiday time picker is

[from] => 2021-03-24 00:00:00 [to] => 2021-03-24 00:00:00

Need to change to

[from] => 2021-03-24 00:00:00 [to] => 2021-03-24 23:59:59

The following is the code I have used

 $fieldset->addField('to', 'date', [
            'name'        => 'to',
            'label'       => __('To Date'),
            'title'       => __('To Date'),
            'date_format' => 'M/d/yyyy',
            'timezone'    => false,
            'value'       => $this->_dateTime->date('m/d/Y')
        ]);
4
  • if end time is fixed then you can append 23:59:59 like this $this->_dateTime->date('m/d/Y')."23:59:59" – Rakesh Varma Mar 25 at 7:09
  • Not working @RakeshVarma – Arjun Mar 25 at 7:17
  • _dateTime which class is this ? – Rakesh Varma Mar 25 at 7:18
  • use Magento\Framework\Stdlib\DateTime\DateTime; – Arjun Mar 25 at 8:50

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.