File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ async function main() {
4242 const startTime = new Date ( event . start . dateTime ) ;
4343 const formattedStartTime = startTime . toLocaleString ( 'zh-TW' , { timeZone : 'Asia/Taipei' , hour12 : false } ) ;
4444
45+ let timeString = `**時間:** ${ formattedStartTime } ` ;
46+ if ( event . end && event . end . dateTime ) {
47+ const endTime = new Date ( event . end . dateTime ) ;
48+ const formattedEndTime = endTime . toLocaleString ( 'zh-TW' , { timeZone : 'Asia/Taipei' , hour12 : false } ) ;
49+ timeString += ` - ${ formattedEndTime } ` ;
50+ }
51+
4552 // Select quote randomly
4653 const randomIndex = Math . floor ( Math . random ( ) * QUOTES . length ) ;
4754 const selectedQuote = QUOTES [ randomIndex ] ;
@@ -52,7 +59,7 @@ async function main() {
5259 color : getRandomColor ( ) , // Use random color
5360 title : `🗓️ ${ event . summary } ` ,
5461 title_link : event . htmlLink ,
55- text : `**時間:** ${ formattedStartTime }
62+ text : `${ timeString }
5663
5764**地點/連結:** ${ event . location || event . description || event . hangoutLink || '未指定' }
5865
You can’t perform that action at this time.
0 commit comments