seymuromarov/dater 问题修复 & 功能扩展

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

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固