承接 surazdott/nepali-date 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

surazdott/nepali-date

最新稳定版本:v1.1.3

Composer 安装命令:

composer require surazdott/nepali-date

包简介

Laravel package to convert English date into Nepali.

README 文档

README

Laravel Nepali Date

GitHub Workflow Status (main) Latest Version CodeFactor License

Introduction

Laravel Nepali Date package is a package integrates seamlessly with Laravel, allowing developers to effortlessly manage date conversions according to the Nepali calendar system.

Installation

You can install the package via composer. Run the following command in your terminal:

composer require surazdott/nepali-date

Basic usages

Laravel will automatically discover this package. Hence, you don't need to add the service provider manually. It supports Nepali dates up to 2100 BS.

Let's look at a simple example using Facade:

use Carbon\Carbon;
use NepaliDate\Facades\NepaliDate;

NepaliDate::create(Carbon::now())->toBS(); // 2080-12-20
NepaliDate::create(Carbon::now())->toFormattedBSDate(); // 21 Chaitra 2080, Wednesday
NepaliDate::create(Carbon::now())->toFormattedNepaliDate(); // २१ चैत २०८०, बुधवार

Using Carbon Macroable Trait:

$user->created_at->toBS(); // 2080-12-20
$user->created_at->toFormattedNepaliDate(); // २१ चैत २०८०, बुधवार

Format Specifiers

Here are some commonly used format specifiers.

  • Y - Year in four digits (2080)
  • m - Month in digit (12)
  • F - Month in full name (January/बैशाख)
  • d - Day in digit
  • l - Day in full name (Sunday/आइतबार)
NepaliDate::create(Carbon::now())->toNepaliFormat('Y-m-d'); // २०८०-१२-२१
NepaliDate::create(Carbon::now())->toBSformat('d F Y'); // 21 Chaitra 2080

Testing

composer test

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request. Contributions are welcome!

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 370
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-04