baramofme / notion-gcal-sync-appsscript

0 stars 0 forks source link

endless update look #15

Closed baramofme closed 1 month ago

baramofme commented 1 month ago

image

sync date is always set behind last edited date. even if i never touch those items.

baramofme commented 1 month ago
    function getBaseNotionProperties(event_id, calendar_name) {
        // console.log('getBaseNotionProperties', calendar_name)
        return {
            [CONFIG.LAST_SYNC_PROP_NOTION]: {
                type: "date",
                date: {
                    start: new Date().toISOString(),
                },
            },

There are differences between the generated last sync value and the actual sync value...

baramofme commented 1 month ago

Notion last sync date filed is not changed.

baramofme commented 1 month ago

OKay SYNC TO GCAL WORKS.. all values synced to gcal.

just this program not update notion event's last sync date prop.

baramofme commented 1 month ago

fixed!!

    function updateNotionPageLastSyncDate(pageId) {
        const now = new Date()
        now.setMinutes(now.getMinutes())

        let properties = {
            [CONFIG.LAST_SYNC_PROP_NOTION]: {
                type: "date",
                date: {
                    // start: new Date().toISOString(),
                    start: now.toISOString(),
                },
            },
        }
        API.NOTION.updateNotionPage(properties, pageId);
    }