{"id":21108455,"url":"https://github.com/televisionninja/daily-intervals","last_synced_at":"2026-04-21T20:32:28.702Z","repository":{"id":112327395,"uuid":"348897279","full_name":"TelevisionNinja/daily-intervals","owner":"TelevisionNinja","description":"Create intervals that are based on the time","archived":false,"fork":false,"pushed_at":"2022-11-14T15:05:44.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-08T10:52:09.941Z","etag":null,"topics":["intervals","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TelevisionNinja.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-18T00:58:48.000Z","updated_at":"2021-12-11T09:10:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a33da9c-9c7c-4289-a1a0-bf1a87abf71b","html_url":"https://github.com/TelevisionNinja/daily-intervals","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.15000000000000002","last_synced_commit":"20ac6bd6e5545e77daf328b30dda87c767376d4a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelevisionNinja%2Fdaily-intervals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelevisionNinja%2Fdaily-intervals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelevisionNinja%2Fdaily-intervals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelevisionNinja%2Fdaily-intervals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TelevisionNinja","download_url":"https://codeload.github.com/TelevisionNinja/daily-intervals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243552888,"owners_count":20309634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["intervals","javascript"],"created_at":"2024-11-20T00:46:37.342Z","updated_at":"2025-12-29T20:04:47.511Z","avatar_url":"https://github.com/TelevisionNinja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# daily-intervals\nCreate intervals that are based on the time\n\n## Usage\n\n```javascript\nimport {\n    setDailyInterval,\n    clearDailyInterval\n} from 'daily-intervals';\n\n/*\nThis executes every 2 hours\nThe intervals start at 1 am\n\nMeaning the times it will execute will be:\n\n      This is the given starting time\n                     |\n                     V\n..., 21:00, 23:00, 1:00, 3:00, 5:00, 7:00, ...\n\nThe interval will not wait until the current time has reached the starting time to execute the callback function. The closest interval will be used as the time to execute the function.\n\nExample:\n\nCurrent time: 22:34\n\n   Execution time    Starting time\n              |      |\n              V      V\n..., 21:00, 23:00, 1:00, 3:00, 5:00, 7:00, ...\n\nThe callback function will be executed at 23:00 in this example\n*/\nsetDailyInterval(() =\u003e {\n    console.log('hello world');\n}, 2 * 60, '1:00');\n\n//------------------\n// similar usage to setTimeout and setInterval\n\nsetDailyInterval(() =\u003e {\n    console.log('Hello world 1');\n});\n\nsetDailyInterval(() =\u003e {\n    console.log('Hello world 2');\n}, 2);\n\nsetDailyInterval(() =\u003e {\n    console.log('Hello world 3');\n}, 3, '3:33');\n\nsetDailyInterval((a, b, c) =\u003e {\n    console.log(a, b, c);\n}, 4, '4:44', '1', '2', '3');\n\nsetDailyInterval(\"console.log('Hello world 4');\");\n\n//------------------\n// clearing a dailyInterval\n\nconst id = setDailyInterval(() =\u003e console.log('cleared'));\nclearDailyInterval(id);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelevisionninja%2Fdaily-intervals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelevisionninja%2Fdaily-intervals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelevisionninja%2Fdaily-intervals/lists"}