reind33r/simpledateformatter

0.1.0 2019-02-03 19:13 UTC

This package is auto-updated.

Last update: 2024-09-29 05:08:44 UTC


README

此包为Laravel提供了一种简单而有效的Blade指令来格式化本地化日期。

安装

通过Composer

$ composer require reind33r/simpledateformatter

使用方法

在您的Blade模板中

@localized_date($date, $date_format='long|full|short', $time_format=true|false)

如果未提供(或提供了错误的)$date_format值,则默认格式为短格式。
如果未提供时间格式的时间值,则默认为false。

该包使用在您的Laravel应用程序中配置的区域设置来构建IntlDateFormatter对象,然后使用预定义的PHP格式

  • IntlDateFormatter::LONG
  • IntlDateFormatter::FULL
  • IntlDateFormatter::SHORT

变更日志

这是第一个版本。

许可证

此包根据MIT许可证授权。