承接 fadyreda99/laravel-date-helper 相关项目开发

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

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

fadyreda99/laravel-date-helper

Composer 安装命令:

composer require fadyreda99/laravel-date-helper

包简介

Flexible date-to-MySQL-date parser (Arabic digits/months + many formats) for Laravel

README 文档

README

A lightweight Laravel package that converts any human-written date string — including Arabic digits, Arabic month names, timestamps, and messy formats — into a clean MySQL-compatible date (Y-m-d).

This package solves a common real-world problem:

Users enter dates in many different formats.
Your backend needs one consistent format.

DateHelper intelligently detects, normalizes, and validates dates coming from forms, mobile apps, imports, or mixed Arabic/English inputs.

🌟 Features

  • Converts almost any date format into Y-m-d
  • Full support for Arabic digits (٠١٢٣٤٥٦٧٨٩)
  • Full support for Persian digits (۰۱۲۳۴۵۶۷۸۹)
  • Arabic month names support (مارس, أكتوبر, أغسطس …)
  • Automatic timestamp handling (seconds & milliseconds)
  • Cleans noise (ordinals, commas, NBSP, time parts)
  • Safe fallback using Carbon natural-language parsing
  • Year-range validation to avoid parsing Hijri years incorrectly
  • Graceful error handling (null on failure)
  • No warnings, no exceptions thrown

🚀 Installation

composer require fadyreda99/laravel-date-helper

Laravel automatically discovers the service provider.

🧠 Usage

1️⃣ Static Usage

use Fadyreda99\DateHelper\DateHelper;

$date = DateHelper::toMysqlDate('٠٣/٠٤/٢٠٢٤');
// "2024-04-03"

3️⃣ Dependency Injection

use Fadyreda99\DateHelper\DateHelper;

class MyController
{
    public function store(DateHelper $dates)
    {
        $clean = $dates->toMysqlDate('March 4, 2024');
        // "2024-03-04"
    }
}

🔍 Supported Formats

Numeric:

  • Y-m-d
  • Y/m/d
  • Y.m.d
  • Ymd
  • d-m-Y
  • d/m/Y
  • d.m.Y
  • dmY
  • m-d-Y
  • m/d/Y
  • m.d.Y

Textual:

  • F j, Y
  • F d, Y
  • M j, Y
  • M d, Y
  • j F Y
  • d F Y
  • j M Y
  • d M Y

Mixed:

  • d M Y
  • M d Y
  • d-M-Y
  • d.M.Y

Natural Language Fallback:

  • "today"
  • "yesterday"
  • "tomorrow"
  • "next week"
  • "next month"
  • "last week"
  • "last month"
  • "in 2 days"
  • "in 3 weeks"
  • "-1 day"
  • "+1 day"
  • "+2 months"
  • "last friday"
  • "next tuesday"

🌍 Arabic & Persian Support

Arabic Digit Conversion

٠٣/٠٤/٢٠٢٤03/04/2024

Arabic Month Names

  • مارس → March
  • أكتوبر → October
  • اغسطس → August

Persian Digits

۲۰۲۴-۰۴-۰۳2024-04-03

🕒 Timestamp Support

Supports:

  • 10-digit Unix timestamps
  • 13+ digit millisecond timestamps

Example:

DateHelper::toMysqlDate('1609459200000');
// "2021-01-01"

⚙️ Year Validation

Accepted year range:

1900 → (current year + 5)

Prevents treating Hijri-like dates such as:

1445-01-01

as Gregorian year 1445.

🚫 Error Handling

If the date cannot be parsed, the function returns:

null
  • No exceptions
  • No warnings
  • Safe for forms, DTOs, models, imports

🤝 Contributing

Contributions are welcome!
If you find a missing format, edge case, or improvement — please open an issue or PR.

📄 License

This package is open-source under the MIT License.

fadyreda99/laravel-date-helper 适用场景与选型建议

fadyreda99/laravel-date-helper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 fadyreda99/laravel-date-helper 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-02