定制 ludovicm67/superdate 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ludovicm67/superdate

Composer 安装命令:

composer require ludovicm67/superdate

包简介

Nice methods to know if the specified date is on a weekend/weekday or holiday (for Alsace, France), and some other cool stuff

README 文档

README

Some useful functions for working with dates

Latest Stable Version Total Downloads Coverage Status License

Installation

Just run the following command: composer require ludovicm67/superdate to add it to your PHP project!

Getting started

If you installed using composer, you can now create a file with the following code:

<?php

// import here the composer autoloader
require('./vendor/autoload.php');

// use the namespace for this library
use ludovicm67\SuperDate\Date;

// your code below...

Create a Date object

Many ways to initialize the object.

For example:

// value: today
$date = new Date();
$date = new Date(null);

// value: specified date
$date = new Date("2019-03-21");

All days from one date to an other date

Get an array of all days from the current date to an other one.

Example:

$date = new Date("2019-03-21");
$allDaysTo = $date->allDaysTo("2019-04-03");

// $allDaysTo will be an array containing all 14 days
// between 2019-03-21 and 2019-04-03 included

Is it a week day or a weekend day?

$date->isWeekDay(); // true if between monday and friday, false if saturday or sunday
$date->isWeekEnd(); // false if between monday and friday, true if saturday or sunday

Is it a holiday day?

Based on Alsace, France holidays.

Usage:

$date->isHoliday(); // true if holiday, false if not

Want to contribute?

Feel free to fork, commit and open a pull-request.

Or just open an issue here: https://github.com/ludovicm67/php-superdate/issues.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固