{"id":20031852,"url":"https://github.com/wtnabe/gas-spreadsheet-scheduler","last_synced_at":"2026-06-02T21:31:35.364Z","repository":{"id":193028402,"uuid":"646424423","full_name":"wtnabe/gas-spreadsheet-scheduler","owner":"wtnabe","description":"Let you invoke function scheduled with Spreadsheet table and GAS","archived":false,"fork":false,"pushed_at":"2023-09-06T12:14:06.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T05:27:53.004Z","etag":null,"topics":["gas-library","google-apps-script","spreadsheet"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wtnabe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-28T11:06:37.000Z","updated_at":"2023-09-06T14:23:17.000Z","dependencies_parsed_at":"2023-09-06T12:44:10.742Z","dependency_job_id":null,"html_url":"https://github.com/wtnabe/gas-spreadsheet-scheduler","commit_stats":null,"previous_names":["wtnabe/gas-spreadsheet-scheduler"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wtnabe/gas-spreadsheet-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtnabe%2Fgas-spreadsheet-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtnabe%2Fgas-spreadsheet-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtnabe%2Fgas-spreadsheet-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtnabe%2Fgas-spreadsheet-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtnabe","download_url":"https://codeload.github.com/wtnabe/gas-spreadsheet-scheduler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtnabe%2Fgas-spreadsheet-scheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33838215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gas-library","google-apps-script","spreadsheet"],"created_at":"2024-11-13T09:34:57.728Z","updated_at":"2026-06-02T21:31:35.349Z","avatar_url":"https://github.com/wtnabe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpreadsheetScheduler for Google Apps Script\n\nLet you create schedule table on Spreadsheet with Google Apps Script Project ( Sheets Container-boiund script )\n\n## Prerequisite\n\nSheets Container-bound script Project\n\n## How to use\n\n### 1. Open Spreadsheet and prepare schedule like below\n\n| A | B | C |\n| --- | --- | --- |\n| 2023-06-01 | 4日後です |  |\n| 日付じゃない |  |  |\n| 2023-05-26 | 一昨日です |  |\n| 2023-05-27 | 昨日です | ✔️ |\n| 2023-05-28 | 当日です |  |\n\n### 2. Open menu [ Extensions ] -\u003e [ Apps Script ]\n\n#### 2-1. Add Library code\n\nChoose one of them please.\n\n 1. add Project ID for you project as Library `1lfmVVWxHmyXqfR8pnFJlDY2P_ys-w96HCZSsoTcGvgQU0AQ9JncLO5w0`\n 2. Copy and Paste this code\n\nI would recommend #2 for speed of execution, but #1 is also a good option for administrative costs.\n\n#### 2-2. Prepare code like below\n\n```javascript\n/** review past and future plans */\nfunction reviewPlans() {\n  const scheduler = SpreadsheetScheduler.createSpreadsheetScheduler()\n  const dateUtils = SpreadsheetScheduler.createDateUtils()\n  const today = dateUtils.today()\n  const range = SpreadsheetApp.getActiveSpreadsheet().getRange('Sheet1!A1:C')\n\n  const [since, until] = dateUtils.thisWeek()\n\n  scheduler.executeWhenMet({\n    range,\n    selector: (date) =\u003e date \u003c since,\n    executor: tooooLate,\n    skipCol: 2, batch: true\n  })\n\n  scheduler.executeWhenMet({\n    range,\n    selector: (date) =\u003e dateUtils.inThisWeek(date) \u0026\u0026 today \u003c= date,\n    executor: hereWeGo,\n    skipCol: 2, batch: true\n  })\n}\n\n/**\n * @param {object} row\n * @param {number} dateCol\n * @param {number} skipCol\n * @returns {string}\n */\nfunction buildRow(row, dateCol, skipCol) {\n  const scheduler = SpreadsheetScheduler.createSpreadsheetScheduler()\n\n  return [row[dateCol].toLocaleDateString(), ...scheduler.restOfRow(row)].join('\\t')\n}\n\n/** display future ( today or later ) plans */\nfunction hereWeGo (values, dateCol, skipCol) {\n  if (values.length \u003e 0) {\n    console.log('This week\\'s remaining plan listed as below:')\n    console.log(values.map((row) =\u003e buildRow(row, dateCol, skipCol)).join('\\n'))\n  }\n}\n\n/** warn incompleted tasks */\nfunction tooooLate (values, dateCol, skipCol) {\n  if (values.length \u003e 0) {\n    console.log('Too Late ! Hurry up !')\n    console.log(values.map((row) =\u003e buildRow(row, dateCol, skipCol)).join('\\n'))\n  }\n}\n```\n\n#### Result\n\nIf you run on Monday,\n\n```\nToo Late ! Hurry up !\n5/26/2023\t一昨日です\nThis week's remaining plan listed as below:\n6/1/2023\t4日後です\n5/28/2023\t当日です\n```\n\nIf there are still rows in Spreadsheet containing dates that correspond to `lastWeek()`, they will be output.\n\nIf `skipCol` is specified and this column contains some data, it acts as a completion flag, so in the result above, the \"yesterday\" row is not output.\n\n### 3. create Trigger for repetitive execution\n\n * 3-1. Switch tab to [ Triggers ] on left side\n * 3-2. Add Trigger from right bottom button\n\n## Features\n\n * read Spreadsheet Range, and pick schedules with selector function ( default, it detects the very day )\n * invoke action with executor function\n * skip mark column available ( ex, 「完了」 or \"Done\" )\n * switch batch mode is true ( executor receive whole range values ) or not ( executor receive row array )\n\n## Options\n\nSpreadsheetScheduler.executeWhenMet() function accept these options.\n\n\u003cdl\u003e\n\u003cdt\u003e\u003cstrong\u003erange\u003c/strong\u003e : Range ( required )\u003c/dt\u003e\n\u003cdd\u003eGoogle Spreadsheet Range Object. read values \u003c/dd\u003e\n\u003cdt\u003e\u003cstrong\u003eexecutor\u003c/strong\u003e : Function ( optional / dumpRow() or dumpRange() )\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003cstrong\u003eselector\u003c/strong\u003e : Funtion ( optional / isAppointedDay() )\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003cstrong\u003edateCol\u003c/strong\u003e : Integer ( optional / default 0 )\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003cstrong\u003eskipCol\u003c/strong\u003e : Integer ( optional / default `undefined` )\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003cstrong\u003ebatch\u003c/strong\u003e : Boolean ( optional / default `false` )\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\n### Selector Function\n\nThe Selector Function has one argument.\n\n * date\n\nand should return Boolean. ( used with Array.prototype.filter() )\n\nYou can write any function about date determination.\n\n```javascript\n  scheduler.executeWhenMet({\n    range: SpreadsheetApp.getActiveSpreadsheet().getRange('Sheet1!A1:B'),\n    selector: (date) =\u003e date \u003e= from \u0026\u0026 date \u003c to,\n    ..\n  })\n```\n\n### Executor Function\n\nThe Executor Function has two modes.\n\n1. row mode ( default )\n\nreceives the following arguments\n\n * row ( Array )\n * dateCol\n * skipCol\n\nThe built-in dumpRow() function is the dead simple example.\n\n2. batch mode ( when `batch` options is true )\n\nreceives the following arguments\n\n * values ( Array of Array )\n * dateCol\n * skipCol\n\nThe built-in dumpRange() function is the dead simple example, too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtnabe%2Fgas-spreadsheet-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtnabe%2Fgas-spreadsheet-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtnabe%2Fgas-spreadsheet-scheduler/lists"}