{"id":15743184,"url":"https://github.com/awilum/craft-nice","last_synced_at":"2025-03-13T09:32:50.939Z","repository":{"id":63654566,"uuid":"569243084","full_name":"Awilum/craft-nice","owner":"Awilum","description":"A nice plugin with nice functions for nice data representation in Craft CMS.","archived":false,"fork":false,"pushed_at":"2022-12-15T08:40:50.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"1.x","last_synced_at":"2024-10-11T03:07:34.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Awilum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://awilum.github.io/donate"]}},"created_at":"2022-11-22T11:55:39.000Z","updated_at":"2023-08-13T19:24:01.000Z","dependencies_parsed_at":"2022-11-23T07:48:12.907Z","dependency_job_id":null,"html_url":"https://github.com/Awilum/craft-nice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Awilum%2Fcraft-nice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Awilum%2Fcraft-nice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Awilum%2Fcraft-nice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Awilum%2Fcraft-nice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Awilum","download_url":"https://codeload.github.com/Awilum/craft-nice/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221359375,"owners_count":16804794,"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-10-04T03:01:38.075Z","updated_at":"2024-10-24T23:06:02.607Z","avatar_url":"https://github.com/Awilum.png","language":"PHP","funding_links":["https://awilum.github.io/donate"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eNice plugin for \u003ca href=\"https://github.com/craftcms\"\u003eCraft CMS\u003c/a\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg?label=License\" alt=\"License MIT\"\u003e \u003cimg alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/awilum/craft-nice?label=Stars\"\u003e \u003cimg alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/awilum/craft-nice?label=Forks\"\u003e \u003ca href=\"https://hitsofcode.com\"\u003e\u003cimg alt=\"Hits of Code\" src=\"https://hitsofcode.com/github/awilum/craft-nice?branch=1.x\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA nice plugin with nice functions for nice data representation in Craft CMS.\n\n## Requirements\n\n* **Craft CMS**: ^4.0\n* **PHP**: ^8.0\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n    ```\n    cd /path/to/project\n    ```\n\n2. In your terminal run `composer require awilum/craft-nice`.\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Nice.\n\n### Usage\n\nDisplay nice file size in the twig tempalates:\n\n```\n//=\u003e 1 MB\n{{ niceFileSize(1000000) }}\n\n//=\u003e 976.56 KiB\n{{ niceFileSize(1000000, false) }}\n\n//=\u003e 1 MB\n{{ 1000000 | niceFileSize }}\n\n//=\u003e 976.56 KiB\n{{ 1000000 | niceFileSize(false) }}\n```\n\nDisplay nice number in the twig tempalates:\n\n```\n//=\u003e 10,050,050\n{{ niceNumber(10050050) }}\n\n//=\u003e 10,050,050.00\n{{ niceNumber(10050050, 2) }}\n\n//=\u003e 10,050,050/00\n{{ niceNumber(10050050, 2, '/') }}\n\n//=\u003e 10:050:050/00\n{{ niceNumber(10050050, 2, '/', ':') }}\n\n//=\u003e 10,050,050\n{{ 10050050 | niceNumber() }}\n\n//=\u003e 10,050,050.00\n{{ 10050050 | niceNumber(2) }}\n\n//=\u003e 10,050,050/00\n{{ 10050050 | niceNumber(2, '/') }}\n\n//=\u003e 10:050:050/00\n{{ 10050050 | niceNumber(2, '/', ':') }}\n```\n\nDisplay nice date time in the twig tempalates:\n\n```\n//=\u003e November 23, 2022, 4:24 am\n{{ niceDateTime(1669177469) }}\n\n//=\u003e November 23, 2022, 4:24 am\n{{ 1669177469 | niceDateTime }}\n```\n\nDisplay nice file name in the twig tempalates:\n\n```\n//=\u003e foo-bar\n{{ niceFileName('foo bar') }}\n\n//=\u003e foo-bar\n{{ 'foo bar' | niceFileName }}\n```\n\nUse Nice `niceDateTime` function in the PHP:\n\n```php\nuse function Awilum\\CraftNice\\niceDateTime;\n\necho niceDateTime(1669177469);\n```\n\n## LICENSE\n[The MIT License (MIT)](https://github.com/awilum/craft-nice/blob/master/LICENSE.md)\nCopyright (c) [Sergey Romanenko](https://awilum.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawilum%2Fcraft-nice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawilum%2Fcraft-nice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawilum%2Fcraft-nice/lists"}