{"id":22059280,"url":"https://github.com/opentable/ot-availability-phrases","last_synced_at":"2025-07-24T00:31:46.486Z","repository":{"id":24378650,"uuid":"27778216","full_name":"opentable/ot-availability-phrases","owner":"opentable","description":"nodejs code for generating availability-phrases","archived":true,"fork":false,"pushed_at":"2017-09-18T15:50:02.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-06-10T18:23:34.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/opentable.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}},"created_at":"2014-12-09T17:30:34.000Z","updated_at":"2025-04-02T10:36:07.000Z","dependencies_parsed_at":"2022-08-25T20:40:59.483Z","dependency_job_id":null,"html_url":"https://github.com/opentable/ot-availability-phrases","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opentable/ot-availability-phrases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fot-availability-phrases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fot-availability-phrases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fot-availability-phrases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fot-availability-phrases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentable","download_url":"https://codeload.github.com/opentable/ot-availability-phrases/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fot-availability-phrases/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264688343,"owners_count":23649650,"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":[],"created_at":"2024-11-30T17:27:50.424Z","updated_at":"2025-07-24T00:31:46.221Z","avatar_url":"https://github.com/opentable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ot-availability-phrases\n======================\n\n[![Build Status](https://travis-ci.org/opentable/ot-availability-phrases.png?branch=master)](https://travis-ci.org/opentable/ot-availability-phrases) [![NPM version](https://badge.fury.io/js/ot-availability-phrases.png)](http://badge.fury.io/js/ot-availability-phrases) ![Dependencies](https://david-dm.org/opentable/ot-availability-phrases.png)\n\nGenerate availability phrases from a day-schedule:\n\ne.g.\n\n\"Mon-Fri 11:00-22:00\"\n\ninstallation:\n\n```\nnpm install ot-availability-phrases\n```\n\nusage:\n\n```\nvar builder = require('ot-availability-phrases');\n\nvar phrases = builder.getAvailabilityPhrases('en-GB', [\n  {\n    DayOfWeek: 0,\n    Schedule: [{\n      First: '09:35:00',\n      Last: '14:15:00'\n    }] \n  },\n  {\n    DayOfWeek: 1,\n    Schedule: [{\n      First: '09:35:00',\n      Last: '14:15:00'\n    }] \n  }\n]);\n\nconsole.log(phrases[0]);\n// \"Sun-Mon 09:35-14:15\"\n\n```\n\n__getAvailabilityPhrases(locale, schedule)__\n\n- locale: can either be a string (e.g. `en-GB`, `en`) or an array of languages (sorted by quality) `[{ code: 'en', region: 'GB', quality: 1.0}, ... ]` (as given by [accept-language-parser](https://www.npmjs.com/package/accept-language-parser)\n\n- schedule: array of days with an array of time-ranges for each\n\n__Running tests__\n```\nnpm install\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fot-availability-phrases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentable%2Fot-availability-phrases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fot-availability-phrases/lists"}