承接 etdatepickerlaravel/ethiopian-datepicker 相关项目开发

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

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

etdatepickerlaravel/ethiopian-datepicker

Composer 安装命令:

composer require etdatepickerlaravel/ethiopian-datepicker

包简介

A comprehensive Laravel package for Ethiopian calendar datepicker with Gregorian calendar conversion

README 文档

README

A comprehensive Laravel package that provides Ethiopian calendar datepicker functionality with Gregorian calendar conversion. Perfect for applications that need to support Ethiopian date selection with accurate conversion between Ethiopian and Gregorian calendars.

Features

  • 📅 Dual Calendar Support: Switch between Ethiopian and Gregorian calendars
  • 🔄 Accurate Date Conversion: Precise conversion between Ethiopian and Gregorian dates
  • 🌍 Localization: Support for Amharic, transliterated, and English day/month names
  • 📱 Responsive Design: Mobile-friendly interface
  • 🎨 Customizable: Configurable themes and styling options
  • Laravel Integration: Blade components and Laravel-specific features
  • 🔧 Easy Installation: Simple composer installation and configuration

Requirements

  • PHP 7.4 or higher
  • Laravel 8.0 or higher

Installation

Step 1: Install via Composer

composer require etdatepickerlaravel/ethiopian-datepicker

Step 2: Publish Assets (Optional)

Publish the configuration file:

php artisan vendor:publish --tag=ethiopian-datepicker-config

Publish the assets (CSS and JavaScript):

php artisan vendor:publish --tag=ethiopian-datepicker-assets

Publish the views (if you want to customize them):

php artisan vendor:publish --tag=ethiopian-datepicker-views

Or publish everything at once:

php artisan vendor:publish --tag=ethiopian-datepicker

Usage

Basic Usage

Using Blade Component

<x-ethiopian-datepicker 
    name="birth_date"
    placeholder="Select your birth date"
    :required="true"
/>

With Custom Options

<x-ethiopian-datepicker 
    name="event_date"
    id="event-date-picker"
    placeholder="Select event date"
    :show-gregorian="true"
    :show-ethiopian="true"
    default-calendar="ethiopian"
    classes="form-control custom-class"
/>

In Your Blade Layout

Make sure to include the styles and scripts in your layout:

<!DOCTYPE html>
<html>
<head>
    <!-- Other head elements -->
    @stack('styles')
</head>
<body>
    <!-- Your content -->
    
    @stack('scripts')
</body>
</html>

Using in Forms

<form method="POST" action="/events">
    @csrf
    
    <div class="form-group">
        <label for="event_date">Event Date</label>
        <x-ethiopian-datepicker 
            name="event_date"
            :value="old('event_date')"
            :required="true"
        />
        @error('event_date')
            <span class="error">{{ $message }}</span>
        @enderror
    </div>
    
    <button type="submit">Save Event</button>
</form>

JavaScript API

You can also initialize the datepicker programmatically:

// Initialize Ethiopian datepicker
const datepicker = new EthiopianDatepicker(document.getElementById('my-date-input'), {
    showGregorian: true,
    showEthiopian: true,
    defaultCalendar: 'ethiopian',
    onChange: function(data) {
        console.log('Ethiopian Date:', data.ethiopian);
        console.log('Gregorian Date:', data.gregorian);
        console.log('Formatted:', data.formatted);
    }
});

PHP Usage

You can also use the Ethiopian calendar conversion in your PHP code:

use WorthyERP\EthiopianDatepicker\EthiopianCalendar;

$calendar = new EthiopianCalendar();

// Convert Gregorian to Ethiopian
$ethiopianDate = $calendar->toEthiopian(new DateTime('2024-01-15'));
// Returns: ['year' => 2016, 'month' => 5, 'day' => 6, 'monthName' => 'Tir', ...]

// Convert Ethiopian to Gregorian
$gregorianDate = $calendar->toGregorian(2016, 5, 6);
// Returns: DateTime object

// Get today in Ethiopian calendar
$today = $calendar->today();

// Format Ethiopian date
$formatted = $calendar->format($ethiopianDate, 'full');
// Returns: "Monday, 6 Tir 2016"

Configuration

The configuration file config/ethiopian-datepicker.php allows you to customize:

  • Default calendar type (Gregorian or Ethiopian)
  • Date formats
  • Language settings
  • Styling options
  • Validation rules
return [
    'default_calendar' => 'gregorian',
    'show_both_calendars' => true,
    'date_format' => [
        'gregorian' => 'Y-m-d',
        'ethiopian' => 'd/m/Y',
    ],
    'language' => [
        'month_names' => [...],
        'weekday_names' => [...],
    ],
    // ... more options
];

Component Properties

Property Type Default Description
name string 'date' Input name attribute
id string null Input ID (defaults to name)
value string null Initial value
placeholder string 'Select a date...' Placeholder text
required boolean false Whether the field is required
showGregorian boolean true Show Gregorian calendar option
showEthiopian boolean true Show Ethiopian calendar option
defaultCalendar string 'gregorian' Default calendar to display
classes string '' Additional CSS classes

Ethiopian Calendar Information

The Ethiopian calendar has:

  • 13 months: 12 months of 30 days each, plus Pagumen (5 or 6 days)
  • Leap years: Occur every 4 years (when year % 4 = 3)
  • New Year: Meskerem 1 (around September 11 in Gregorian)
  • 7-8 year difference: Ethiopian year is 7-8 years behind Gregorian

Month Names

  1. Meskerem (መስከረም)
  2. Tikimt (ጥቅምት)
  3. Hidar (ኅዳር)
  4. Tahsas (ታኅሣሥ)
  5. Tir (ጥር)
  6. Yekatit (የካቲት)
  7. Megabit (መጋቢት)
  8. Miazia (ሚያዝያ)
  9. Ginbot (ግንቦት)
  10. Sene (ሰኔ)
  11. Hamle (ሐምሌ)
  12. Nehase (ነሐሴ)
  13. Pagumen (ጳጉሜን)

Examples

Example 1: Birth Date Field

<div class="form-group">
    <label>Birth Date</label>
    <x-ethiopian-datepicker 
        name="birth_date"
        placeholder="Select birth date"
        :show-gregorian="true"
        :show-ethiopian="true"
        default-calendar="ethiopian"
    />
</div>

Example 2: Event Date with Validation

<x-ethiopian-datepicker 
    name="event_date"
    :value="$event->date ?? old('event_date')"
    :required="true"
    classes="@error('event_date') is-invalid @enderror"
/>

Example 3: Ethiopian Only

<x-ethiopian-datepicker 
    name="ethiopian_date"
    :show-gregorian="false"
    :show-ethiopian="true"
    default-calendar="ethiopian"
/>

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This package is open-sourced software licensed under the MIT license.

Credits

  • Developed by EtDatepickerLaravel
  • Ethiopian calendar conversion algorithms based on established conversion methods
  • Inspired by the need for accurate Ethiopian date handling in Laravel applications

Support

For issues, questions, or suggestions, please open an issue on GitHub.

Changelog

Version 1.0.0

  • Initial release
  • Ethiopian calendar support
  • Gregorian calendar integration
  • Blade component
  • JavaScript API
  • PHP conversion utilities

etdatepickerlaravel/ethiopian-datepicker 适用场景与选型建议

etdatepickerlaravel/ethiopian-datepicker 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「calendar」 「conversion」 「laravel」 「datepicker」 「hijri」 「ethiopian」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 etdatepickerlaravel/ethiopian-datepicker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 etdatepickerlaravel/ethiopian-datepicker 我们能提供哪些服务?
定制开发 / 二次开发

基于 etdatepickerlaravel/ethiopian-datepicker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-23