{"id":30873746,"url":"https://github.com/jonesiscoding/arranged","last_synced_at":"2025-09-07T23:50:13.312Z","repository":{"id":56966719,"uuid":"455898447","full_name":"jonesiscoding/arranged","owner":"jonesiscoding","description":"PHP Library with objects for managing date formats and formatting for date periods.","archived":false,"fork":false,"pushed_at":"2025-07-07T15:27:42.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T17:43:46.927Z","etag":null,"topics":["date","dateperiod","datetime","format","formatter","period","php","reduce","time","truncate"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonesiscoding.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,"zenodo":null}},"created_at":"2022-02-05T14:53:49.000Z","updated_at":"2025-07-07T15:27:16.000Z","dependencies_parsed_at":"2025-06-18T23:18:10.824Z","dependency_job_id":"878a20a4-58b6-4242-9b66-aba1b79cd3be","html_url":"https://github.com/jonesiscoding/arranged","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jonesiscoding/arranged","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Farranged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Farranged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Farranged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Farranged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonesiscoding","download_url":"https://codeload.github.com/jonesiscoding/arranged/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Farranged/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274113046,"owners_count":25224334,"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-09-07T02:00:09.463Z","response_time":67,"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":["date","dateperiod","datetime","format","formatter","period","php","reduce","time","truncate"],"created_at":"2025-09-07T23:50:04.173Z","updated_at":"2025-09-07T23:50:13.299Z","avatar_url":"https://github.com/jonesiscoding.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dates Arranged\nPHP Library with objects for managing date formats and formatting for date periods.\n\n### Formatting Functionality\n\nUtilizing the `DevCoding\\Arranged\\Helper\\DatePeriodFormatter::format` method, a native PHP `DatePeriod` object can be\nformatted using the same tokens as the `\\DateTimeInterface::format` method. The end date string is modified to remove\nany redundant portions.  For example, if the start \u0026 end dates are on the same calendar day, the date is entirely\nremoved from the end date string. For more examples, see the `format` method.\n\n### Reduction Functionality\n\nUtilizing the `DevCoding\\Arranged\\Helper\\DatePeriodFormatter::reduce` method, a native PHP `DatePeriod` object can be\nformatted using the same tokens as the `\\DateTimeInterface::format` method, then reduced in length to a specific length\nor as much as possible. For example, if the start or end times are at the top of the hour and a separator is included\nin the format string, the separator and the 00 is removed. For more examples, see the `reduce` method.\n\n### Convenience Class\n\nFor convenience, the `DevCoding\\Arranged\\Object\\DatePeriod` class extends the native PHP `DatePeriod` class with`format` \nand `reduce` methods that utilize the methods from `DevCoding\\Arranged\\Helper\\DatePeriodFormatter`.\n\n### Installation \u0026 Usage\n\nInstallation is simple via composer `composer require deviscoding/arranged`.\n\nUsage is simple:\n\n    $StartDate  = new \\DateTime('2021-01-06 14:20:00')\n    $EndDate    = new \\DateTime('2021-01-06 23:32:00');\n    $Interval   = new \\DateInterval('PT15M');\n    $DatePeriod = new \\DevCoding\\DevCoding\\Object\\Date\\DatePeriod($StartDate, $Interval, $EndDate);\n    $formatted  = $DatePeriod-\u003eformat('l, F dS g:ia');\n    $reduced    = $DatePeriod-\u003ereduce('l, F dS g:ia', 40);\n    $further    = $DatePeriod-\u003ereduce('l, F dS g:ia');\n    echo $formatted.' OR '.$reduced.' OR '.$further;\n\nThe above should print *Wednesday, January 6th 2:20pm-11:30pm OR Wednesday, January 6th 2:20-11:30pm OR Wed, Jan 6th, \n2:20-11:30pm*.\n\n### Dependencies\nThere are no dependencies for this library other than PHP 7+.\n\n### Saying Thanks\nTo be honest, simply telling a friend about this library would be thrilling. Well, that is, if I knew about it. So,\nmaybe star the repo, mention [@jonesiscoding](https://twitter.com/jonesiscoding/) in a tweet, or drop me a line via\nthe email address found in the source.\n\nI enjoy coding enough that writing code can be its own reward, but writing code that no one ever sees or uses is\nquite boring. I'll be very glad if this little library gets some use beyond its original use case.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonesiscoding%2Farranged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonesiscoding%2Farranged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonesiscoding%2Farranged/lists"}