Tweeted twitter.com/StackMagento/status/932918594014470144
2 added 483 characters in body
source | link

I wonder what 'date' type needs in system.xml. I keep getting the error :

system.xml (only the field):

<field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Start sync from :</label>
</field>

error :

Exception #0 (Exception): Output format is not specified. Please specify "format" key in constructor, or set it using setFormat().

If i add a format :

        <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Start sync from :</label>
            <format>yyyy-MM-dd</format>
        </field>

error :

Element 'format': This element is not expected.

So what wants it? And how can i add time to it? (i need a epoch time eventually in the DB).

EDIT :

This error comes from :

\Magento\Framework\Data\Form\Element\Date : 150-158

$dateFormat = $this->getDateFormat() ?: $this->getFormat();
        $timeFormat = $this->getTimeFormat();
        if (empty($dateFormat)) {
            throw new \Exception(
                'Output format is not specified. ' .
                'Please specify "format" key in constructor, or set it using setFormat().'
            );
        }

I wonder what 'date' type needs in system.xml. I keep getting the error :

system.xml (only the field):

<field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Start sync from :</label>
</field>

error :

Exception #0 (Exception): Output format is not specified. Please specify "format" key in constructor, or set it using setFormat().

If i add a format :

        <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Start sync from :</label>
            <format>yyyy-MM-dd</format>
        </field>

error :

Element 'format': This element is not expected.

So what wants it? And how can i add time to it? (i need a epoch time eventually in the DB).

I wonder what 'date' type needs in system.xml. I keep getting the error :

system.xml (only the field):

<field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Start sync from :</label>
</field>

error :

Exception #0 (Exception): Output format is not specified. Please specify "format" key in constructor, or set it using setFormat().

If i add a format :

        <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Start sync from :</label>
            <format>yyyy-MM-dd</format>
        </field>

error :

Element 'format': This element is not expected.

So what wants it? And how can i add time to it? (i need a epoch time eventually in the DB).

EDIT :

This error comes from :

\Magento\Framework\Data\Form\Element\Date : 150-158

$dateFormat = $this->getDateFormat() ?: $this->getFormat();
        $timeFormat = $this->getTimeFormat();
        if (empty($dateFormat)) {
            throw new \Exception(
                'Output format is not specified. ' .
                'Please specify "format" key in constructor, or set it using setFormat().'
            );
        }
1
source | link

Date field system.xml

I wonder what 'date' type needs in system.xml. I keep getting the error :

system.xml (only the field):

<field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Start sync from :</label>
</field>

error :

Exception #0 (Exception): Output format is not specified. Please specify "format" key in constructor, or set it using setFormat().

If i add a format :

        <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Start sync from :</label>
            <format>yyyy-MM-dd</format>
        </field>

error :

Element 'format': This element is not expected.

So what wants it? And how can i add time to it? (i need a epoch time eventually in the DB).