seymuromarov/dater
Composer 安装命令:
composer require seymuromarov/dater
包简介
Laravel api for converting date for humans reading
关键字:
README 文档
README
Laravel api for converting date for humans reading (without depending on server localization)
Requirements
Installation
Require package:
composer require seymuromarov/dater
For laravel versions below 5.5 you must add provider and alias if your version is 5.5+ you must skip adding alias and provider
Now add the service provider in config/app.php file:
'providers' => [
// ...
Seymuromarov\Dater\DaterServiceProvider::class,
],
after this add alias in config/app.php file:
'aliases' => [
//...
'Dater' => Seymuromarov\Dater\Facades\Dater::class,
],
use command (optional):
composer dump-autoload
now u can use api like this
use Seymuromarov\Dater\Facades\Dater; //it is not necessary
$date="2018-01-05";
$format="d m y";
$lang="en"; // az, ru u can ask for more languages
Dater::convert($date,$format,$lang);
Dater::convert($date,$format); //$default lang is english
//result: 5 january 2017
more formats are available
available formats are :
//m,m-1,m-2,m-3,m-4,m-5,m-6... it will just grab substring from month with given length
//d only 1 day format is available
//y only 1 year format is available
Some examples are given below :
use Seymuromarov\Dater\Facades\Dater; //it is not necessary
$date="2018-01-05";
$format="d m-3 y";
Dater::convert($date,$format);
//result: 5 jan 2017
$format="d m-3 y2";
Dater::convert($date,$format);
//result: 5 jan 17
$format="m-2 d y2";
Dater::convert($date,$format);
//result: ja 5 17
seymuromarov/dater 适用场景与选型建议
seymuromarov/dater 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「laravel」 「human date」 「azerbaijan」 「Date Conversion」 「Dater」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 seymuromarov/dater 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 seymuromarov/dater 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 seymuromarov/dater 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
This package provide a PDF module for yawik.
Generates human-readable strings for PHP DateTime objects
Helper class to provide useful time related functions.
Human SMS Gateway Client API
The Winter Sitemap Pretty plugin allows you to to prettify a sitemap.xml file generated by wn-sitemap-plugin for your website to make it human readable
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-03