fix(index): trim club name from event titles and simplify calendar name
- Modified `title` generation to remove the club name prefix if it exists. - Updated `calName` to display only the club name instead of adding "的比赛" suffix. - This prevents redundant information in the calendar event titles.
This commit is contained in:
parent
4b69ed3b84
commit
93f2cd6525
@ -63,7 +63,7 @@ const server = serve({
|
|||||||
} } : {}),
|
} } : {}),
|
||||||
start: ics.convertTimestampToArray(dayjs.tz(e.startDate, 'Asia/Tokyo').toDate().getTime(), 'local') ,
|
start: ics.convertTimestampToArray(dayjs.tz(e.startDate, 'Asia/Tokyo').toDate().getTime(), 'local') ,
|
||||||
duration: { hours: 6, minutes: 30 },
|
duration: { hours: 6, minutes: 30 },
|
||||||
title: e.title,
|
title: e.title.replace(clubInfo?.name || '', ''),
|
||||||
// end: dayjs(event.startDate).add(6, 'h').add(30, 'minute').format('YYYY-MM-DD HH:mm'),
|
// end: dayjs(event.startDate).add(6, 'h').add(30, 'minute').format('YYYY-MM-DD HH:mm'),
|
||||||
// description: 'Annual 10-kilometer run in Boulder, Colorado',
|
// description: 'Annual 10-kilometer run in Boulder, Colorado',
|
||||||
// url: e.url,
|
// url: e.url,
|
||||||
@ -83,7 +83,7 @@ const server = serve({
|
|||||||
// ]
|
// ]
|
||||||
}));
|
}));
|
||||||
const data: string = await new Promise(resolve => ics.createEvents(configs, {
|
const data: string = await new Promise(resolve => ics.createEvents(configs, {
|
||||||
calName: clubInfo?.name ? `${clubInfo.name}的比赛` : '',
|
calName: clubInfo?.name ? `${clubInfo.name}` : '',
|
||||||
}, (err, data) => {
|
}, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user