Helpers\Date

The Date helper is used for calculations with dates.

Date::difference($from, $to, $type = null)

$from, $to - from and to date in the format: YYYY-MM-DD HH:MM::SS

$type - default to null will return an array containing:

[y] => 0
[m] => 2
[d] => 26
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 1
[days] => 86
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0

to return a set item like the number of days pass d as the third parameter.

Date::businessDays($startDate, $endDate, $weekendDays = false)

Get the number of days between 2 dates, set $weekendDays to true to get the number of weekends.

Date::businessDates($startDate, $endDate, $nonWork = 6)

Get an array of dates between 2 dates (not including weekends). $nonWork day of week(int) where weekend begins - 5 = fri -> sun, 6 = sat -> sun, 7 = sunday

Date::daysInMonth($month = 0, $year = '')

Takes a month/year as input and returns the number of days for the given month/year. Takes leap years into consideration.

Helpers\Date的更多相关文章

  1. Config

    Config Config App Auth Cache Database Languages Mail Modules Routing Session Config Settings for the ...

  2. Handlebars块级Helpers

    1.Handlebars简单介绍: Handlebars是JavaScript一个语义模板库,通过对view和data的分离来快速构建Web模板.它采用"Logic-less templat ...

  3. ios开发分类--NSDate+Helpers

    #import <Foundation/Foundation.h> @interface NSDate (Helpers) @end #import "Date.h" ...

  4. Helpers\TableBuilder

    Helpers\TableBuilder Table builder helper is a class that would help you to create tables in MySQL ( ...

  5. (转)MVC语法-@helpers和@functions(Razor内定义函数)

    (转)MVC语法-@helpers和@functions(Razor内定义函数) 转自:http://www.mikesdotnetting.com/Article/173/The-Differenc ...

  6. 3.12 Templates -- Wrting Helpers(编写辅助器)

    一.概述 1. Helpers允许你向你的模板添加超出在Ember中开箱即用的额外的功能.辅助器是最有用的,用于将来自模型和组件的原始值转换成更适合于用户的格式. 2. 例如,假设我们有一个Invoi ...

  7. Yii2 yii\helpers\ArrayHelper

    yii\helpers\ArrayHelper 是一个数组辅助类,提供额外的数组功能函数 toArray($object, $properties = [], $recursive = true) C ...

  8. The Difference Between @Helpers and @Functions In WebMatrix

    from: http://www.mikesdotnetting.com/article/173/the-difference-between-helpers-and-functions-in-web ...

  9. js 函数的防抖(debounce)与节流(throttle) 带 插件完整解析版 [helpers.js]

    前言:         本人纯小白一个,有很多地方理解的没有各位大牛那么透彻,如有错误,请各位大牛指出斧正!小弟感激不尽.         函数防抖与节流是做什么的?下面进行通俗的讲解. 本文借鉴:h ...

随机推荐

  1. 【转】Android开发调试工具ADB的使用

    原文网址:http://www.cnblogs.com/meil/archive/2012/05/24/2516055.html ADB(Android Debug Bridge)是Android S ...

  2. jquery通过ajax获取数据,控制显示的数据条数

    效果图: 现在我们可以先看它的json数据,如图所示:                然后可以对应我们的代码进行理解. jquery通过ajax获取数据,并通过窗口大小控制显示的数据条数,以及可以根据 ...

  3. android中Invalidate和postInvalidate的区别

    Android中实现view的更新有两组方法,一组是invalidate,另一组是postInvalidate,其中前者是在UI线程自身中使用,而后者在非UI线程中使用. Android提供了Inva ...

  4. 从ramdisk根文件系统启动Linux成功,及使用initramfs启动linux

    下面两篇文章是ARM9论坛上的讲解ramdisk文件系统的很不错的文章 今天做了个试验,让Linux2.6.29.4从ramdisk根文件系统启动成功,总结一下. 其中涉及的内容较多,很多东西不再详述 ...

  5. javascript六难题

    1.下面代码的运行效果是什么?为什么? <html> <head> <meta charset="utf-8"> <title>DO ...

  6. 关于SQL中的Update语句

    今天在SQL数据库操作时需要将一张表中的数据Update到另一张表中去, 可是用我以往的写法确怎么也不能成功.代码如下: update table1 a set a.Col1=b.Col2 from ...

  7. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.5.5

    Show that the inner product $$\bex \sef{x_1\vee \cdots \vee x_k,y_1\vee \cdots\vee y_k} \eex$$ is eq ...

  8. python学习之optparse

    Python 有两个内建的模块用于处理命令行参数: 一个是 getopt,<Deep in python>一书中也有提到,只能简单处理 命令行参数: 另一个是 optparse,它功能强大 ...

  9. python bisect模块

    转发:http://www.cnblogs.com/skydesign/archive/2011/09/02/2163592.html 先看看模块的结构: 前面五个属性大家感兴趣可以打出来看看数值,这 ...

  10. _int、NSInteger、NSUInteger、NSNumber的区别和联系

    1.首先先了解下NSNumber类型: 苹果官方文档地址:https://developer.apple.com/library/ios/documentation/Cocoa/Reference/F ...