kartik-v/php-date-formatter
Composer 安装命令:
composer require kartik-v/php-date-formatter
包简介
A Javascript datetime formatting and manipulation library using PHP date-time formats.
README 文档
README
php-date-formatter
A Javascript datetime library that allows you to manipulate date/times using PHP date-time formats in javascript. This library was built with an intention to read and write date/timestamps to the database easily when working with PHP server code. Use cases for this library would involve reading and saving a timestamp to database in one format, but displaying it on client or html forms in another format. Maintaining a consistent PHP Date time format for both server side and client side validation should help in building extensible applications with various PHP frameworks easily.
This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery.
Check the CHANGE LOG for release details.
Features
- Parse date/time strings or a Date object, and convert it into Javascript Date Object by passing any of the PHP DateTime formats.
- Automatically guess date/time strings, even if it does not exactly match the format, and convert it into Javascript Date Object.
- Read date/time strings or a Date object, and format it as per a PHP DateTime format.
- With release v1.3.2 the library has been converted to use pure javascript code without dependency on jQuery or other third party JS library.
Documentation and Demo
View the library documentation and library demos at Krajee JQuery plugins.
Installation
Using Bower
You can use the bower package manager to install. Run:
bower install php-date-formatter
Using Composer
You can use the composer package manager to install. Either run:
$ php composer.phar require kartik-v/php-date-formatter "@dev"
or add:
"kartik-v/php-date-formatter": "@dev"
to your composer.json file
Manual Install
You can also manually install the plugin easily to your project. Just download the source ZIP or TAR ball and extract the plugin assets (css and js folders) into your project.
Usage
Step 1 Load the following assets in your header.
<script src="path/to/js/php-date-formatter.min.js" type="text/javascript"></script>
Step 2 You can now access the library using the DateFormatter object. For example, you can convert any date string to javascript date object for a specific PHP date format.
var fmt = new DateFormatter(); var date1 = fmt.parseDate('23-Sep-2013 09:24:12', 'd-M-Y H:i:s'); var date2 = fmt.formatDate(date1, 'd-F-Y h:i:s A');
License
php-date-formatter is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.
kartik-v/php-date-formatter 适用场景与选型建议
kartik-v/php-date-formatter 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.6M 次下载、GitHub Stars 达 46, 最近一次更新时间为 2014 年 07 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「javascript」 「time」 「date」 「formatter」 「datetime」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kartik-v/php-date-formatter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kartik-v/php-date-formatter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kartik-v/php-date-formatter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Tools to convert between .NET and PHP date formats
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Adds the EDTF data type to Wikibase
Date component is a set of methods to help with the manipulation of dates.
统计信息
- 总下载量: 1.6M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 47
- 点击次数: 28
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-07-23