fix: missing date field options with and without timezone in calendar block (#5674)

This commit is contained in:
Katherine 2024-11-18 19:41:56 +08:00 committed by GitHub
parent 1d7da5b7d8
commit 34611c6e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -186,7 +186,7 @@ export const calendarBlockSettings = new SchemaSettings({
return {
title: t('Start date field'),
value: fieldNames.start,
options: getCollectionFieldsOptions(name, 'date', {
options: getCollectionFieldsOptions(name, ['date', 'datetime', 'dateOnly', 'datetimeNoTz', 'unixTimestamp'], {
association: ['o2o', 'obo', 'oho', 'm2o'],
}),
onChange: (start) => {
@ -221,7 +221,7 @@ export const calendarBlockSettings = new SchemaSettings({
return {
title: t('End date field'),
value: fieldNames.end,
options: getCollectionFieldsOptions(name, ['date', 'datetime', 'dateOnly', 'datetimeNoTz'], {
options: getCollectionFieldsOptions(name, ['date', 'datetime', 'dateOnly', 'datetimeNoTz', 'unixTimestamp'], {
association: ['o2o', 'obo', 'oho', 'm2o'],
}),
onChange: (end) => {

View File

@ -70,10 +70,14 @@ export const useCreateCalendarBlock = () => {
const createCalendarBlock = async ({ item }) => {
const stringFieldsOptions = getCollectionFieldsOptions(item.name, 'string', { dataSource: item.dataSource });
const dateFieldsOptions = getCollectionFieldsOptions(item.name, ['date', 'datetime', 'dateOnly', 'datetimeNoTz'], {
association: ['o2o', 'obo', 'oho', 'm2o'],
dataSource: item.dataSource,
});
const dateFieldsOptions = getCollectionFieldsOptions(
item.name,
['date', 'datetime', 'dateOnly', 'datetimeNoTz', 'unixTimestamp'],
{
association: ['o2o', 'obo', 'oho', 'm2o'],
dataSource: item.dataSource,
},
);
const values = await FormDialog(
t('Create calendar block'),