我只需要在日期字段TCA typo3中显示月份和年份

时间:2018-11-06 10:09:46

标签: php typo3-8.x

'construction_period_from' => [
        'exclude' => false,
        'label' => 'LLL:EXT:River/Resources/Private/Language/locallang_db.xlf:River.from',
        'config' => [
            'type' => 'input',
            'renderType' => 'inputDateTime',
            'size' => 7,
            'eval' => 'date',
            'default' => time()
        ],
    ],

这是我正在使用的tca字段。默认情况下,日历加载在后端中。但是我只需要显示月份和年份。时间戳值存储在数据库中。 tca中是否有仅显示月份和年份的选项?

1 个答案:

答案 0 :(得分:0)

您必须在 TCA 文本字段的 value 属性中设置格式。

<f:form.textfield property="tca" value="{newGirlfriend.birthDate->f:format.date(format:'m-d')}" />

我希望这对您有用