jizuscreed/time-approximator
Composer 安装命令:
composer require jizuscreed/time-approximator
包简介
A small library to generate short approximate human friendly time description. Inspired by https://github.com/martinandert/damals
README 文档
README
A small library to generate short approximate human friendly time description. Inspired by https://github.com/martinandert/damals
Installation
composer require jizuscreed/time-approximator
Instantiation
$timeApproximator = new jizuscreed\TimeApproximator\TimeApproximator(new \jizuscreed\TimeApproximator\Languages\Russian());
It can
$this->timeApproximator->getDescriptionFor(20); // полминуты $this->timeApproximator->getDescriptionFor(40); // меньше чем 1 минута $this->timeApproximator->getDescriptionFor(16*60); // 16 минут $this->timeApproximator->getDescriptionFor(11*60); // 11 минут $this->timeApproximator->getDescriptionFor(46*60); // примерно 1 час $this->timeApproximator->getDescriptionFor(43*60); // 43 минуты $this->timeApproximator->getDescriptionFor(68*60); // примерно 1 час $this->timeApproximator->getDescriptionFor(24*60*60*15+23*60*60+15*600; // 16 дней)
Create language pack
Just create class in jizuscreed\TimeApproximator\Languages inheriting jizuscreed\TimeApproximator\Languages\AbstractLanguagePack and implement abstract methods
Contributing
Please, send your pull requests, especially with language packs
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD
- 更新时间: 2020-03-19