invokemedia/parsetime 问题修复 & 功能扩展

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

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

invokemedia/parsetime

Composer 安装命令:

composer require invokemedia/parsetime

包简介

This function can parse times in sentences that are in a range like 11 AM to 5 PM or 5:30 to 1:21.

README 文档

README

This package adds a single function called parse_time to your project. It does one thing. Parses times.

This function can parse times that are in a range like 11-5 or 11 AM to 5 PM.

By passing a second argument (boolean) you can turn common words into their 24 hour equivalent.

For example: 11 AM - Midnight would become 11 AM - 0:00.

Installation

Put a file named composer.json at the root of your project, containing your project dependencies:

{
    "require": {
        "invokemedia/parsetime": ">=1.0"
    }
}

Or use composer require invokemedia/parsetime

Usage

parse_time('11 AM - 5 PM');
parse_time('11:22 - 5:31');
parse_time('I will arrive at 1:22 and leave at 9:45');
parse_time('11 AM - Midnight', true); // would become 11 AM - 0:00

The function basically wraps up the date_parse function. It will be run over the match for 11 AM and 5 PM.

Check out the test file for some of the examples.

Running tests

Go to the project root and run phpunit.

License

The MIT License

Copyright (c) 2016 Invoke Media webmaster@invokemedia.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固