承接 achristodoulou/calendar 相关项目开发

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

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

achristodoulou/calendar

Composer 安装命令:

composer require achristodoulou/calendar

包简介

A package that provides easy access to calendar functionality.

README 文档

README

Latest Version on Packagist Build Status Software License

This package can be used for any calendar related queries. For example you can check if today is a specific date, if is public holidays, is working day, is working hours, is lunch time, is Christmas any many more.

Install

Via Composer

$ composer require achristodoulou/calendar

Usage

use \Achristodoulou\Calendar\Day;
use \Achristodoulou\Calendar\ListOfDates;
use \Achristodoulou\Calendar\TimeRange;
use \Achristodoulou\Calendar\TwentyFourHourTime;
use \Achristodoulou\Calendar\Today;

$currentTime = new DateTime();

$workingHours = new TimeRange(new TwentyFourHourTime('08:00'), new TwentyFourHourTime('18:00'));

$publicHolidays = new ListOfDates();
$publicHolidays->add(new DateTime('2015-01-18'));

$annualLeave = new ListOfDates();
$annualLeave->add(new DateTime('2015-07-30'));

$lunchTime = new TimeRange(new TwentyFourHourTime('12:00'), new TwentyFourHourTime('01:00'));

$today = new Today($currentTime, $workingHours, $publicHolidays, $annualLeave, $lunchTime);

echo "\nToday is Thursday: "                . ($today->is(Day::THURSDAY)          ? 'yes' : 'no');
echo "\nToday is Assumption Day: "          . ($today->isAssumptionDay()          ? 'yes' : 'no');
echo "\nToday is Public Holiday: "          . ($today->isPublicHoliday()          ? 'yes' : 'no');
echo "\nNow is After Working Hours: "       . ($today->isAfterWorkingHour()       ? 'yes' : 'no');
echo "\nToday I am on Annual Leave: "       . ($today->isAnnualLeave()            ? 'yes' : 'no');
echo "\nToday is Annunciation Day: "        . ($today->isAnnunciationDay()        ? 'yes' : 'no');
echo "\nToday is Christmas Day: "           . ($today->isChristmas()              ? 'yes' : 'no');
echo "\nToday is Epiphany Day: "            . ($today->isEpiphanyDay()            ? 'yes' : 'no');
echo "\nToday is Labour Day: "              . ($today->isLabourDay()              ? 'yes' : 'no');
echo "\nNow is Lunch Time: "                . ($today->isLunchTime()              ? 'yes' : 'no');
echo "\nToday is Midnight Of Working Day: " . ($today->isMidnightOfWorkingDay()   ? 'yes' : 'no');
echo "\nToday is New Year Day: "            . ($today->isNewYearDay()             ? 'yes' : 'no');
echo "\nToday is Noon of Working Day: "     . ($today->isNoonOfWorkingDay()       ? 'yes' : 'no');
echo "\nToday is Weekend: "                 . ($today->isWeekend()                ? 'yes' : 'no');
echo "\nToday is Working Day: "             . ($today->isWorkingDay()             ? 'yes' : 'no');
echo "\nNow is Working Hour: "              . ($today->isWorkingHour()            ? 'yes' : 'no');

Output:

Today is Thursday: yes
Today is Assumption Day: no
Today is Public Holiday: no�
Now is After Working Hours: yes
Today I am on Annual Leave: no
Today is Annunciation Day: no
Today is Christmas Day: no
Today is Epiphany Day: no
Today is Labour Day: no
Now is Lunch Time: no
Today is Midnight Of Working Day: no
Today is New Year Day: no
Today is Noon of Working Day: no
Today is Weekend: no
Today is Working Day: yes
Now is Working Hour: no

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email andreas22@gmail.com instead of using the issue tracker.

Credits

  • [Andreas Christodoulou]

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固