{"id":17774110,"url":"https://github.com/joho1968/availabletimephp","last_synced_at":"2025-08-12T17:41:38.311Z","repository":{"id":259415546,"uuid":"877814404","full_name":"joho1968/availabletimephp","owner":"joho1968","description":"Availability class for PHP (AvailableTime)","archived":false,"fork":false,"pushed_at":"2024-10-24T12:58:58.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T20:54:25.611Z","etag":null,"topics":["availability","business-hours","opensource","php","php-class","php7","php8","php81","php82"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joho1968.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2024-10-24T09:37:48.000Z","updated_at":"2024-10-24T12:57:34.000Z","dependencies_parsed_at":"2024-10-31T00:35:41.664Z","dependency_job_id":null,"html_url":"https://github.com/joho1968/availabletimephp","commit_stats":null,"previous_names":["joho1968/availabletimephp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/joho1968/availabletimephp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joho1968%2Favailabletimephp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joho1968%2Favailabletimephp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joho1968%2Favailabletimephp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joho1968%2Favailabletimephp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joho1968","download_url":"https://codeload.github.com/joho1968/availabletimephp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joho1968%2Favailabletimephp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108385,"owners_count":24528759,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["availability","business-hours","opensource","php","php-class","php7","php8","php81","php82"],"created_at":"2024-10-26T21:49:46.979Z","updated_at":"2025-08-12T17:41:38.263Z","avatar_url":"https://github.com/joho1968.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Software License](https://img.shields.io/badge/License-AGPLv3-green.svg?style=flat-square)](LICENSE) [![PHP 7](https://img.shields.io/badge/PHP7-blue.svg?style=flat-square)](https://php.net) [![PHP 8](https://img.shields.io/badge/PHP8-blue.svg?style=flat-square)](https://php.net)\n\n# Availability class for PHP (AvailableTime)\n\n## Description\n\nThis class provides the means to check a number of parameters against a given time and date to determine availability.\n\nIt could, for example, be used to show business operating hours, or a simple booking availability indicator.\n\n## Demo\n\nYou can see the code in action in the form of a Bludit CMS plugin on [bludit-bs5simplyblog.joho.se/areweopen](https://bludit-bs5simplyblog.joho.se/areweopen)\n\n## Requirements\n\nPHP 7.x, PHP 8.x, and so on ... :blush:\n\n## Installation\n\n1. Download the `availabletime.class.php` file.\n2. Alternatively, also download `test_available_time.php` file\n3. Include it in your project and play with it\n\n## Usage\n\nSee the file `test_available_time.php` for sample usage.\n\n### Time and date range\n\nFor the `exception_times` parameter, you may use specific dates (YYYYMMDD), or a range of dates where either start or end can be omitted.\n\nTo specify a range, use `YYYYMMDD-YYYYMMDD`, `YYYYMMDD-`, `-YYYYMMDD`. The `YYYY` part may also be expressed as `????` to mean every year on the specified month and day.\n\nFor the daily schedule, time slots are specified as `HHMM-HHMM`, `HHMM-` and/or `-HHMM`.\n\nThe code assumes dates to be specified as `YYYYMMDD` and times as `HHMM` (24h format)\n\n## Changelog\n\n### 1.0.1 (2024-10-24)\n* Added support for wildcard year parameter in exception dates\n\n### 1.0.0 (2024-10-24)\n* Initial release\n\n## Other notes\n\nThis code has only been tested with PHP 8.1.x, but should work with other versions too. If you find an issue with your specific PHP version, please let me know and I will look into it.\n\n## License\n\nPlease see [LICENSE](LICENSE) for a full copy of AGPLv3.\n\nCopyright 2024 [Joaquim Homrighausen](https://github.com/joho1968); all rights reserved.\n\nThis file is part of AvailableTime. AvailableTime is free software.\n\nAvailableTime is free software: you may redistribute it and/or modify it  under\nthe terms of the GNU AFFERO GENERAL PUBLIC LICENSE v3 as published by the\nFree Software Foundation.\n\nAvailableTime is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE. See the GNU AFFERO GENERAL PUBLIC LICENSE\nv3 for more details.\n\nYou should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE v3\nalong with the AvailableTime package. If not, write to:\n```\nThe Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor\nBoston, MA  02110-1301, USA.\n```\n\n## Disclaimer\n\nDisclaimer: There's nothing magic about this code and there are many other, and, probably, better ways to accomplish this\n\n## Credits\n\nThe AvailableTime class was written by Joaquim Homrighausen while converting :coffee: into code.\n\n## Note\n\nIf there is something you feel to be missing from this code, or if you have found a problem with the code or a feature, please do not hesitate to create a new issue on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoho1968%2Favailabletimephp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoho1968%2Favailabletimephp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoho1968%2Favailabletimephp/lists"}