【问题标题】:I need to show only month and year in date field TCA typo3我只需要在日期字段 TCA 错字3 中显示月份和年份
【发布时间】:2018-11-06 10:09:45
【问题描述】:
'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 中是否有任何选项可以仅显示月份和年份?

【问题讨论】:

    标签: php typo3-8.x


    【解决方案1】:

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

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

    希望对你有用

    【讨论】:

    • 我需要它在 tca 中实现。在这种情况下,我认为流体不会有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多