# Dates

Dates checks.

Source:
  - dates.js, line 1

### Methods

#### (inner) dateBetween(date, startDate, endDate) → {boolean}

Check if date is between start date and end date

Interfaces: `not`

Source:
  - dates.js, line 306

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object
`startDate` | `Date` | start date object
`endDate` | `Date` | end date object

##### Returns:

Type:
  `boolean`

##### Example

    be.dateBetween(new Date('2017-05-12'), new Date('2017-03-10'), new Date('2017-07-25')) // true
    be.not.dateBetween(new Date('2017-05-12'), new Date('2017-03-10'), new Date('2017-07-25')) // false

#### (inner) dateString(value) → {boolean}

Check if is date string

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 36

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | `string` | string date

##### Returns:

Type:
  `boolean`

##### Example

    be.dateString('2017-06-20') // true
    be.dateString('hello') // false

#### (inner) day(date, day) → {boolean}

Check if date is day specified

Interfaces: `not`

Source:
  - dates.js, line 163

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object
`day` | `string` | day can be 'sunday','monday','tuesday','wednesday','thursday','friday','saturday'

##### Returns:

Type:
  `boolean`

##### Example

    be.day(new Date('2017-06-24'), 'saturday') // true
    be.day(new Date('2017-06-25'), 'monday') // false
    be.not.day(new Date('2017-06-25'), 'monday') // true

#### (inner) dayLightSavingTime(date) → {boolean}

Check if date is DST

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 328

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.dayLightSavingTime(new Date('2017-06-24')) // true
    be.dayLightSavingTime(new Date('2017-10-30')) // false

#### (inner) future(date) → {boolean}

Check if date is future

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 144

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.future(new Date('2117-06-24')) // true
    be.all.future(new Date('2117-06-24'), new Date('2007-06-25')) // false
    be.any.future(new Date('2117-06-24'), new Date('2007-06-25')) // true
    be.not.future(new Date('2117-06-24')) // false

#### (inner) leapYear(year) → {boolean}

Check if is leap year

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 231

##### Parameters:

Name | Type | Description
--- | --- | ---
`year` | `number` | year

##### Returns:

Type:
  `boolean`

##### Example

    be.leapYear(2016) // true
    be.leapYear(2017) // false
    be.not.leapYear(2017) // true
    be.all.leapYear(2012, 2016) // true
    be.any.leapYear(2015, 2016) // true

#### (inner) month(date, month) → {boolean}

Check if date is month specified

Interfaces: `not`

Source:
  - dates.js, line 186

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object
`month` | `string` | month can be 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'

##### Returns:

Type:
  `boolean`

##### Example

    be.month(new Date('2017-06-24'), 'june') // true
    be.month(new Date('2017-02-25'), 'march') // false
    be.not.month(new Date('2017-02-25'), 'march') // true

#### (inner) numberInWeek(number) → {boolean}

Check if number is in week, between 0 and 6

Source:
  - dates.js, line 291

##### Parameters:

Name | Type | Description
--- | --- | ---
`number` | `number` | number

##### Returns:

Type:
  `boolean`

##### Example

    be.numberInWeek(0) // true, is sunday
    be.numberInWeek(1) // true, is monday
    be.numberInWeek(7) // false, the days are between 0 and 6

#### (inner) past(date) → {boolean}

Check if date is past

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 127

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.past(new Date('1980-02-05')) // true

#### (inner) timeString(value) → {boolean}

Check if is time string

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 54

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | `string` | string time

##### Returns:

Type:
  `boolean`

##### Example

    be.timeString('22:06:50') // true

#### (inner) today(date) → {boolean}

Check if date is today

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 70

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.today(new Date()) // true

#### (inner) tomorrow(date) → {boolean}

Check if date is tomorrow

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 87

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    let now = new Date();
    let tomorrow = now.setDate(now.getDate() + 1);
    be.tomorrow(tomorrow) // true

#### (inner) weekday(date) → {boolean}

Check if date is weekday

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 272

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.weekday(new Date('2017-06-26')) // true
    be.not.weekday(new Date('2017-06-24')) // true
    be.all.weekday(new Date('2017-06-26'), new Date('2017-06-27')) // true
    be.any.weekday(new Date('2017-06-24'), new Date('2017-06-26')) // true

#### (inner) weekend(date) → {boolean}

Check if date is weekend

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 253

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    be.weekend(new Date('2017-06-24')) // true
    be.not.weekend(new Date('2017-06-24')) // false
    be.all.weekend(new Date('2017-06-24'), new Date('2017-06-25')) // true
    be.any.weekend(new Date('2017-06-24'), new Date('2017-06-26')) // true

#### (inner) year(date, year) → {boolean}

Check if date is the year specified

Interfaces: `not`

Source:
  - dates.js, line 209

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object
`year` | `number` | year

##### Returns:

Type:
  `boolean`

##### Example

    be.year(new Date('2017-06-06'), 2017) // true
    be.not.year(new Date('2017-06-06'), 2017) // false

#### (inner) yesterday(date) → {boolean}

Check if date is yesterday

Interfaces: `all`, `any`, `not`

Source:
  - dates.js, line 107

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | `Date` | date object

##### Returns:

Type:
  `boolean`

##### Example

    let now = new Date();
    let yesterday = now.setDate(now.getDate() - 1);
    be.yesterday(yesterday) // true