承接 sugarcraft/sugar-calendar 相关项目开发

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

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

sugarcraft/sugar-calendar

最新稳定版本:v0.2.0

Composer 安装命令:

composer require sugarcraft/sugar-calendar

包简介

PHP port of EthanEFung/bubble-datepicker — interactive date picker component for terminal UIs. Supports month/year navigation, keyboard navigation, date selection with visual cursor, and customizable styling.

README 文档

README

sugar-calendar

CI codecov Packagist Version License PHP

SugarCalendar

PHP port of EthanEFung/bubble-datepicker — interactive date picker component for terminal UIs. Inspired by the jQuery Datepicker widget.

Features

  • Month/year navigation — prev/next buttons, year select
  • Keyboard navigation — arrow keys, Enter to select, Esc to close
  • Date selection — select/clear a date, visual cursor
  • Today highlight — show current date distinctly
  • Selected date styling — clear visual indicator
  • Pure renderer — outputs ANSI strings, no external TUI framework needed

Install

composer require sugarcraft/sugar-calendar

Quick Start

use SugarCraft\Calendar\Model;
use SugarCraft\Calendar\DatePicker;

$picker = DatePicker::new(new \DateTimeImmutable('2026-05-01'));
$picker = $picker->SelectDate();  // enter "select mode"

echo $picker->View();  // render calendar

Navigation

// Month navigation
$picker = $picker->GoToPreviousMonth();
$picker = $picker->GoToNextMonth();
$picker = $picker->GoToPreviousYear();
$picker = $picker->GoToNextYear();
$picker = $picker->GoToToday();

// Set arbitrary month
$picker = $picker->SetTime(new \DateTimeImmutable('2025-12-01'));

// Selection
$picker = $picker->SelectDate();   // confirm selection
$picker = $picker->ClearDate();    // clear selection

Keyboard Handling

Handle keyboard input by calling the appropriate move methods:

if ($key === 'left')  $picker = $picker->MoveCursorLeft();
if ($key === 'right') $picker = $picker->MoveCursorRight();
if ($key === 'up')    $picker = $picker->MoveCursorUp();
if ($key === 'down')  $picker = $picker->MoveCursorDown();
if ($key === 'enter') $picker = $picker->SelectDate();
if ($key === 'esc')   $picker = $picker->ClearDate();

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固