Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sync_calendar.gs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function onEdit(e) {

_updateScheduledPosts(range, sheet, row);
_insertDashboardLink(sheet, row, "成效報表");
_insertEnhancedDashboardLink(sheet, row, "範圍內的成效");
}

function checkCellPlace(c) {
Expand Down Expand Up @@ -306,6 +307,17 @@ const _insertDashboardLink = (sheet, editedRow, editedValue) => {
linkCell.setRichTextValue(richTextValue);
}

const _insertEnhancedDashboardLink = (sheet, editedRow, editedValue) => {
const linkColumn = 19;
const linkCell = sheet.getRange(editedRow, linkColumn);
const linkUrl = "https://metabase.pycon.tw/question/215?date1=2024-06-01&date2=2024-06-20"
const richTextValue = SpreadsheetApp.newRichTextValue()
.setText(editedValue)
.setLinkUrl(linkUrl)
.build();
linkCell.setRichTextValue(richTextValue);
}

const _updateScheduledPosts = (range, sheet, row) => {
let startTime = new Date();
let editRange = range.getA1Notation().split(":");
Expand Down