承接 aselsan/indonesian-date 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aselsan/indonesian-date

最新稳定版本:v1.1.2

Composer 安装命令:

composer require aselsan/indonesian-date

包简介

Indonesian standard datetime output

README 文档

README

Lightweight Indonesian Standard Datetime Output for CodeIgniter 4

CodeIgniter PHP Version Require

Quick Start

  1. Install with Composer
composer require aselsan/indonesian-date
  1. Set up your entity
use Aselsan\IndonesianDate\Traits\IndonesianDateTraits;
use CodeIgniter\Shield\Entities\User as ShieldUserEntity;

class User extends ShieldUserEntity
{
    use IndonesianDateTraits;

    public function __construct(?array $data = null)
    {
        parent::__construct($data);
    }

Usage

 /**
   * Default parameters for indonesianDate
   * indonesianDate(string $attribute, bool $showDayOfWeek = true, bool $showTime = false)
   */

  echo auth()->user()->indonesianDate('created_at');
  // Result: "Jum'at, 6 September 2024"

  // If you want to hide the day of the week, set the second parameter to false
  echo auth()->user()->indonesianDate('created_at', false);
  // Result: "6 September 2024"

  // If you want to display the time, set the third parameter to true
  echo auth()->user()->indonesianDate('created_at', false, true);
  // Result: "6 September 2024 18:00"

  // Get zodiac sign
  echo auth()->user()->zodiac('tanggal_lahir');
  // Result: "Aquarius"

  // Get age
  echo auth()->user()->age('tanggal_lahir');
  // Result: 18

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-06