Repository: louislam/uptime-kuma
File: server/notification-providers/google-chat.js (JavaScript)

Code before:

            let chatHeader = {
                title: "Uptime Kuma Alert",
            };

            if (monitorJSON && heartbeatJSON) {
                chatHeader["title"] =
                    heartbeatJSON["status"] === UP
                        ? `✅ ${monitorJSON["name"]} is back online`
                        : `🔴 ${monitorJSON["name"]} went down`;
            }

            // always show msg
            let sectionWidgets = [
                {
                    textParagraph: {
                        text: `<b>Message:</b>\n${msg}`,
                    },
                },
            ];

            // add time if available
            if (heartbeatJSON) {
                sectionWidgets.push({
                    textParagraph: {
                        text: `<b>Time (UTC):</b>\n${heartbeatJSON["localDateTime"]}`,
                    },
                });
            }

            // add button for monitor link if available
            const baseURL = await setting("primaryBaseURL");
            if (baseURL) {
                sectionWidgets.push({
                    buttonList: {
                        buttons: [
                            {
                                text: "Visit Uptime Kuma",
                                onClick: {
                                    openLink: {
                                        url:
                                            baseURL + (monitorJSON ? getMonitorRelativeURL(
                                                monitorJSON.id
                                            ) : "/"),
                                    },
                                },
                            },
                        ],
                    },
                });
            }

Review comment (suggestion):
```suggestion
                        text: `<b>Time (${heartbeatJSON["timezone"]}):</b>\n${heartbeatJSON["localDateTime"]}`,
```

Code after:

            let chatHeader = {
                title: "Uptime Kuma Alert",
            };

            if (monitorJSON && heartbeatJSON) {
                chatHeader["title"] =
                    heartbeatJSON["status"] === UP
                        ? `✅ ${monitorJSON["name"]} is back online`
                        : `🔴 ${monitorJSON["name"]} went down`;
            }

            // always show msg
            let sectionWidgets = [
                {
                    textParagraph: {
                        text: `<b>Message:</b>\n${msg}`,
                    },
                },
            ];

            // add time if available
            if (heartbeatJSON) {
                sectionWidgets.push({
                    textParagraph: {
                        text: `<b>Time (${heartbeatJSON["timezone"]}):</b>\n${heartbeatJSON["localDateTime"]}`,
                    },
                });
            }

            // add button for monitor link if available
            const baseURL = await setting("primaryBaseURL");
            if (baseURL) {
                const urlPath = monitorJSON ? getMonitorRelativeURL(monitorJSON.id) : "/";
                sectionWidgets.push({
                    buttonList: {
                        buttons: [
                            {
                                text: "Visit Uptime Kuma",
                                onClick: {
                                    openLink: {
                                        url: baseURL + urlPath,
                                    },
                                },
                            },
                        ],
                    },
                });
            }

            let chatSections = [