emalhamza/afghani-date
最新稳定版本:v1.0.0
Composer 安装命令:
composer require emalhamza/afghani-date
包简介
A package for converting Gregorian dates to Afghan (Hijri) dates and vice versa.
README 文档
README
bash composer require emalhamza/afghani-date
🪄 Usage Import the Package
use EmalHamza\AfghaniDate\AfghaniDate;
Convert Gregorian to Pashto Date
echo AfghaniDate::toAfghaniDate('2025-03-21');
Output Example:
پیلنۍ 1 وری 1404
Convert Gregorian to Dari (Persian) Date
echo AfghaniDate::toAfghaniDateDari('2025-03-21');
Output Example:
شنبه 1 حمل 1404
💻 Laravel Blade Example
@php use EmalHamza\AfghaniDate\AfghaniDate; @endphp
Today's Afghan Date (Pashto): {{ AfghaniDate::toAfghaniDate(now()) }}
Today's Afghan Date (Dari): {{ AfghaniDate::toAfghaniDateDari(now()) }}
🌐 Supported Languages
Pashto → toAfghaniDate()
Dari (Persian) → toAfghaniDateDari()
⚙️ Requirements
PHP >= 8.0
Laravel (optional, works in plain PHP as well)
nesbot/carbon (auto-installed via Composer)
📝 Contributing
Contributions are welcome!
Fork the repository
Create a feature branch (git checkout -b feature-name)
Commit your changes (git commit -m 'Add new feature')
Push to the branch (git push origin feature-name)
Open a Pull Request
🧪 Testing
php artisan tinker
use EmalHamza\AfghaniDate\AfghaniDate; AfghaniDate::toAfghaniDate('2025-03-21');
🧑💻 Author
Emal Hamza 📧 emalhamza@gmail.com 🪪 License
MIT License. See LICENSE
for details. 🔗 Links
GitHub: https://github.com/emalhamza/afghani-date
Packagist: https://packagist.org/packages/emalhamza/afghani-date
3️⃣ Commit and push
bash git add README.md git commit -m "Add complete README file" git push origin main
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-13