surazdott/nepali-date 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固