vij-klim/appointed 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

vij-klim/appointed

Composer 安装命令:

composer require vij-klim/appointed

包简介

Check whether required appointment slot is open or offer closest available one

README 文档

README

GitHub tag license Packagist

Installation

composer require applicazza/appointed

Usage

  • Set up default timezone, i.e.
date_default_timezone_set('Asia/Jerusalem');
  • Instantiate business day
use Applicazza\Appointed\BusinessDay;

// ...
$business_day = new BusinessDay;
  • Create some operating periods and add them to business day. If some operating periods cannot be added then false will be returned and no changes will be applied whatsoever
use Applicazza\Appointed\Period;

// ...

$period_0900_1400 = Period::make(today( 9, 00), today(14, 00));
$period_1600_1900 = Period::make(today(16, 00), today(19, 00));

$business_day->addOperatingPeriods(
    $period_1600_1900,
    $period_0900_1400
);
  • Create some appointments and add them to business day. If some appointments cannot be added then false will be returned and no changes will be applied whatsoever
use Applicazza\Appointed\Appointment;

// ...

$appointment_1100_1130 = Appointment::make(today( 11, 00), today(11, 30));
$appointment_1200_1330 = Appointment::make(today( 12, 00), today(13, 30));

$business_day->addAppointments(
    $appointment_1100_1130,
    $appointment_1200_1330
);
  • To fit previously failed appointment use BusinessDay::fit(Appointment $appointment, $direction = 'forward') that will return either null or recommended Appointment
$business_day->fit($appointment_1300_1330, 'backward');
$business_day->fit($appointment_1300_1330);
  • To delete appointment(s) use BusinessDay::deleteAppointments(Appointment ...$appointment) that will return boolean
$business_day->deleteAppointments($appointment_1300_1330);
  • To delete operating period use BusinessDay::deleteOperatingPeriod(Period $period) that will return boolean
$business_day->deleteOperatingPeriod($period_0900_1400)
  • To edit operating period use BusinessDay::editOperatingPeriod(Period $old_period, Period $new_period) that will return boolean
$business_day->editOperatingPeriod($period_1330_1400, $period_1330_1430)
  • To get whole day agenda use BusinessDay::getAgenda() that will return array of Period and/or Appointment ordered ascending. Since underlying classes implement JsonSerializable interface this data may be easily encoded to json.
$agenda = $business_day->getAgenda();
// To pretty print results
echo json_encode($business_day->getAgenda(), JSON_PRETTY_PRINT), PHP_EOL;

Helpers

use function Applicazza\Appointed\interval;
use function Applicazza\Appointed\today;
// ...
interval($hours = 0, $minutes = 0, $seconds = 0);
today($hours = 0, $minutes = 0, $seconds = 0);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固