{"id":37265449,"url":"https://github.com/maximaster/production-calendar","last_synced_at":"2026-01-16T00:07:55.314Z","repository":{"id":62525622,"uuid":"93767245","full_name":"maximaster/production-calendar","owner":"maximaster","description":"Работа с производственным календарём, встроено получение данных с basicdata.ru","archived":false,"fork":false,"pushed_at":"2018-10-10T10:00:21.000Z","size":13,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-19T17:31:11.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximaster.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-08T15:52:46.000Z","updated_at":"2020-11-30T15:16:37.000Z","dependencies_parsed_at":"2022-11-02T14:15:47.192Z","dependency_job_id":null,"html_url":"https://github.com/maximaster/production-calendar","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/maximaster/production-calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximaster%2Fproduction-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximaster%2Fproduction-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximaster%2Fproduction-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximaster%2Fproduction-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximaster","download_url":"https://codeload.github.com/maximaster/production-calendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximaster%2Fproduction-calendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-16T00:07:54.458Z","updated_at":"2026-01-16T00:07:55.302Z","avatar_url":"https://github.com/maximaster.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Production Calendar\n\nПредоставляет возможность проверить является ли день выходным|праздничным|рабочим.\nДанные предоставлены [basicdata.ru], однако, библиотека позволяет подключить любой источник данных.\n\n# Установка\n\n```bash\ncomposer require maximaster/production-calendar\n```\n\n# Примеры использования\n\nДля полного списка доступных функций обратитесь к phpDoc пубичных методов класса Calendar.\n\n## isFree($day)\nПроверяет, является ли день \"свободным\", т.е. либо праздником, либо рядовым выходным\n```php\nuse Maximaster\\ProductionCalendar\\Calendar;\nuse Maximaster\\ProductionCalendar\\RulesProvider\\BasicdataProvider;\n\n$calendar = Calendar::fromProvider(new BasicdataProvider);\nif ($calendar-\u003eisFreeDay('01.01.2017')) {\n```\n\n## isDay($day, $types)\nПроверяет, относится ли день к определённому типу (или одному из типов, если передан массив). Доступные типы см. константы класса Rules\n```php\nuse Maximaster\\ProductionCalendar\\Rules;\nif ($calendar-\u003eisDay('01.01.2017', [Rules::HOLIDAY, Rules::PRE_HOLIDAY])) {\n```\n\n## getDayType($day)\nВозвращает тип дня\n```php\n$calendar-\u003egetDayType('01.01.2017'); // Rules::REGULAR_REST\n```\n\n## getMonthWorkDaysCount($year, $month)\n## getMonthWorkDaysCount($dayOfMonth)\nВозвращает количество рабочих дней в указанном месяце\n```php\n$calendar-\u003egetMonthWorkDaysCount(2017, 6); // 21\n```\n\n# Кеширование\nПозволяет кешировать результаты любого источника с помощью CacheProvider, в том числе встроенного. Пример:\n```php\nCalendar::fromProvider(new CacheProvider(new BasicdataProvider));\n```\nДля использования необходимо подключить пакет desarrolla2/cache\n\n# Использование как сервиса в Symfony (2.8)\napp/config/services.yml\n```yml\n  app.calendar.basicdata_provider:\n    public: false\n    class: Maximaster\\ProductionCalendar\\RulesProvider\\BasicdataProvider\n\n  app.calendar.cached_basicdata_provider:\n    public: false\n    class: Maximaster\\ProductionCalendar\\RulesProvider\\CacheProvider\n    arguments: [\"@app.calendar.basicdata_provider\"]\n\n  app.calendar:\n    class: Maximaster\\ProductionCalendar\\Calendar\n    factory: ['Maximaster\\ProductionCalendar\\Calendar', fromProvider]\n    arguments: [\"@app.calendar.cached_basicdata_provider\"]\n```\nлюбой код с доступом к контейнеру\n```php\n$calendar = $this-\u003egetContainer()-\u003eget('app.calendar');\n```\n\n[basicdata.ru]:http://basicdata.ru","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximaster%2Fproduction-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximaster%2Fproduction-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximaster%2Fproduction-calendar/lists"}